Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
vadere
vadere
Commits
696cffc9
Commit
696cffc9
authored
Aug 10, 2018
by
Stefan Schuhbaeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new Processor key and file class for new overlap processor
parent
281c9ee1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
0 deletions
+94
-0
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/datakey/TimestepPedestrianIdOverlap.java
...s/dataprocessing/datakey/TimestepPedestrianIdOverlap.java
+77
-0
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/outputfile/TimestepPedestrianIdOverlapOutputFile.java
...ing/outputfile/TimestepPedestrianIdOverlapOutputFile.java
+17
-0
No files found.
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/datakey/TimestepPedestrianIdOverlap.java
0 → 100644
View file @
696cffc9
package
org.vadere.simulator.projects.dataprocessing.datakey
;
import
org.jetbrains.annotations.NotNull
;
import
org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile
;
import
java.util.Objects
;
@OutputFileMap
(
outputFileClass
=
TimestepPedestrianIdOverlapOutputFile
.
class
)
public
class
TimestepPedestrianIdOverlap
implements
DataKey
<
TimestepPedestrianIdOverlap
>
{
private
final
int
timeStep
;
private
final
int
pedId1
;
private
final
int
pedId2
;
public
TimestepPedestrianIdOverlap
(
int
timeStep
,
int
pedId1
,
int
pedId2
)
{
this
.
timeStep
=
timeStep
;
this
.
pedId1
=
pedId1
;
this
.
pedId2
=
pedId2
;
}
public
static
String
[]
getHeaders
(){
return
new
String
[]{
TimestepKey
.
getHeader
(),
PedestrianIdKey
.
getHeader
(),
"overlapedWithPedestrianId"
};
}
public
int
getTimeStep
()
{
return
timeStep
;
}
public
int
getPedId1
()
{
return
pedId1
;
}
public
int
getPedId2
()
{
return
pedId2
;
}
public
String
[]
toStrings
(){
return
new
String
[]{
Integer
.
toString
(
timeStep
),
Integer
.
toString
(
pedId1
),
Integer
.
toString
(
pedId1
)};
}
@Override
public
int
compareTo
(
@NotNull
TimestepPedestrianIdOverlap
o
)
{
int
result
=
Integer
.
compare
(
this
.
timeStep
,
o
.
timeStep
);
if
(
result
==
0
)
{
result
=
Integer
.
compare
(
this
.
pedId1
,
o
.
pedId1
);
if
(
result
==
0
){
result
=
Integer
.
compare
(
this
.
pedId2
,
o
.
pedId2
);
}
}
return
result
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
TimestepPedestrianIdOverlap
that
=
(
TimestepPedestrianIdOverlap
)
o
;
return
timeStep
==
that
.
timeStep
&&
pedId1
==
that
.
pedId1
&&
pedId2
==
that
.
pedId2
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
timeStep
,
pedId1
,
pedId2
);
}
@Override
public
String
toString
()
{
return
"TimestepPedestrianIdOverlap{"
+
"timeStep="
+
timeStep
+
", pedId1="
+
pedId1
+
", pedId2="
+
pedId2
+
'}'
;
}
}
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/outputfile/TimestepPedestrianIdOverlapOutputFile.java
0 → 100644
View file @
696cffc9
package
org.vadere.simulator.projects.dataprocessing.outputfile
;
import
org.vadere.annotation.factories.outputfiles.OutputFileClass
;
import
org.vadere.simulator.projects.dataprocessing.datakey.TimestepPedestrianIdOverlap
;
@OutputFileClass
(
dataKeyMapping
=
TimestepPedestrianIdOverlap
.
class
)
public
class
TimestepPedestrianIdOverlapOutputFile
extends
OutputFile
<
TimestepPedestrianIdOverlap
>{
public
TimestepPedestrianIdOverlapOutputFile
()
{
super
(
TimestepPedestrianIdOverlap
.
getHeaders
());
}
@Override
public
String
[]
toStrings
(
final
TimestepPedestrianIdOverlap
key
){
return
key
.
toStrings
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment