Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
6c627813
Commit
6c627813
authored
Apr 08, 2019
by
Stefan Schuhbaeck
Browse files
Merge branch 'measurementAreaRefactorProcessors_rebased' into 'master'
Measurement area refactor processors rebased See merge request
!55
parents
dcffc7d3
83cb5e48
Pipeline
#103785
passed with stages
in 137 minutes and 9 seconds
Changes
296
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation/MigrationAssistant/.gitkeep
0 → 100644
View file @
6c627813
Documentation/MigrationAssistant/Overview.md
0 → 100644
View file @
6c627813
# MigrationAssistant
VadereAnnotation/src/org/vadere/annotation/factories/dataprocessors/DataProcessorClass.java
View file @
6c627813
...
...
@@ -25,4 +25,6 @@ public @interface DataProcessorClass {
String
label
()
default
""
;
String
description
()
default
""
;
String
[]
processorFlags
()
default
{};
}
VadereAnnotation/src/org/vadere/annotation/factories/dataprocessors/DataProcessorFactoryProcessor.java
View file @
6c627813
...
...
@@ -5,6 +5,8 @@ import com.google.auto.service.AutoService;
import
org.vadere.annotation.factories.BaseFactoryProcessor
;
import
java.io.PrintWriter
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Set
;
import
javax.annotation.processing.Processor
;
...
...
@@ -12,6 +14,10 @@ import javax.annotation.processing.SupportedAnnotationTypes;
import
javax.annotation.processing.SupportedSourceVersion
;
import
javax.lang.model.SourceVersion
;
import
javax.lang.model.element.Element
;
import
javax.lang.model.element.TypeElement
;
import
javax.lang.model.type.TypeMirror
;
import
javax.lang.model.util.Elements
;
import
javax.lang.model.util.Types
;
@SupportedAnnotationTypes
(
"org.vadere.annotation.factories.dataprocessors.DataProcessorClass"
)
@SupportedSourceVersion
(
SourceVersion
.
RELEASE_11
)
...
...
@@ -32,10 +38,23 @@ public class DataProcessorFactoryProcessor extends BaseFactoryProcessor {
protected
void
addLastConstructor
(
Set
<?
extends
Element
>
elements
,
PrintWriter
writer
)
{
for
(
Element
e
:
elements
)
{
writer
.
append
(
" addMember("
);
writer
.
append
(
e
.
getSimpleName
().
toString
()).
append
(
".class, "
);
writer
.
append
(
"this::"
).
append
(
"get"
).
append
(
name
(
e
)).
append
(
", "
);
writer
.
append
(
quote
(
label
(
e
))).
append
(
", "
);
writer
.
append
(
quote
(
descr
(
e
))).
println
(
"); "
);
writer
.
append
(
quote
(
descr
(
e
))).
append
(
", "
);
writer
.
append
(
e
.
getSimpleName
().
toString
()).
append
(
".class"
);
//if flags are provides here...
String
[]
flags
=
processorFlags
(
e
);
if
(
flags
.
length
>
0
){
writer
.
append
(
", "
);
for
(
int
i
=
0
;
i
<
flags
.
length
-
1
;
i
++)
{
writer
.
append
(
quote
(
flags
[
i
])).
append
(
", "
);
}
writer
.
append
(
quote
(
flags
[
flags
.
length
-
1
]));
writer
.
println
(
"); "
);
}
else
{
writer
.
println
(
"); "
);
}
}
}
...
...
@@ -76,4 +95,29 @@ public class DataProcessorFactoryProcessor extends BaseFactoryProcessor {
return
dataProcessorClass
.
description
();
}
private
String
[]
processorFlags
(
Element
element
){
DataProcessorClass
dataProcessorClass
=
element
.
getAnnotation
(
DataProcessorClass
.
class
);
Elements
elementUtil
=
processingEnv
.
getElementUtils
();
Types
typeUtil
=
processingEnv
.
getTypeUtils
();
ArrayList
<
String
>
flags
=
new
ArrayList
<>();
TypeMirror
processorFlag
=
elementUtil
.
getTypeElement
(
"org.vadere.simulator.projects.dataprocessing.flags.ProcessorFlag"
)
.
asType
();
// cast possible becuse element is a class
TypeElement
e
=
(
TypeElement
)
element
;
for
(
TypeMirror
anInterface
:
e
.
getInterfaces
())
{
if
(
typeUtil
.
isAssignable
(
anInterface
,
processorFlag
)){
flags
.
add
(
typeUtil
.
asElement
(
anInterface
).
getSimpleName
().
toString
());
}
}
flags
.
addAll
(
Arrays
.
asList
(
dataProcessorClass
.
processorFlags
()));
return
flags
.
toArray
(
String
[]::
new
);
}
}
VadereAnnotation/src/org/vadere/annotation/factories/migrationassistant/MigrationTransformation.java
View file @
6c627813
...
...
@@ -7,10 +7,10 @@ import java.lang.annotation.Target;
@Target
(
ElementType
.
TYPE
)
@FactoryType
(
factoryClassName
=
"J
olt
TransformationFactory"
,
extendedClassName
=
"J
olt
TransformationBaseFactory"
,
factoryImports
=
{
"org.vadere.simulator.projects.migration.j
olt
tranformation.J
olt
TransformationBaseFactory"
},
factoryPackage
=
"org.vadere.simulator.projects.migration.j
olt
tranformation"
factoryClassName
=
"J
son
TransformationFactory"
,
extendedClassName
=
"J
son
TransformationBaseFactory"
,
factoryImports
=
{
"org.vadere.simulator.projects.migration.j
son
tranformation.J
son
TransformationBaseFactory"
},
factoryPackage
=
"org.vadere.simulator.projects.migration.j
son
tranformation"
)
public
@interface
MigrationTransformation
{
...
...
VadereGui/testResources/test-scenario.scenario
View file @
6c627813
{
"name" : "Neues_Szenario",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"commithash" : "warning: no commit hash",
"processWriters" : {
"files" : [ {
...
...
@@ -75,20 +75,8 @@
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityVoronoiProcessor",
"attributes" : {
"measurementArea" : {
"x" : 5.0,
"y" : 2.0,
"width" : 1.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"voronoiArea" : {
"x" : 5.0,
"y" : 2.0,
"width" : 1.0,
"height" : 1.0,
"type" : "RECTANGLE"
}
"measurementAreaId" : 1,
"voronoiMeasurementAreaId" : 1
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaSpeedProcessor",
...
...
@@ -148,26 +136,14 @@
"id" : 15,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianWaitingTimeProcessor",
"attributes" : {
"waitingArea" : {
"x" : 5.0,
"y" : 2.0,
"width" : 1.0,
"height" : 1.0,
"type" : "RECTANGLE"
}
"waitingAreaId" : 1
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianWaitingEndTimeProcessor",
"id" : 16,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianWaitingEndTimeProcessor",
"attributes" : {
"waitingArea" : {
"x" : 5.0,
"y" : 2.0,
"width" : 1.0,
"height" : 1.0,
"type" : "RECTANGLE"
}
"waitingAreaId" : 1
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianOSMStrideLengthProcessor",
...
...
@@ -341,7 +317,17 @@
"acceleration" : 2.0
},
"dynamicElements" : [ ],
"attributesCar" : null
"attributesCar" : null,
"measurementAreas" : [ {
"shape" : {
"x" : 5.0,
"y" : 2.0,
"width" : 1.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"id" : 1
} ]
}
}
}
\ No newline at end of file
VadereModelTests/TestEvents/BangEvent/scenarios/01_unsupported_event_exception_for_unsupported_models.scenario
View file @
6c627813
{
"name" : "01_unsupported_event_exception_for_unsupported_models",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -112,6 +112,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/BangEvent/scenarios/02_bang_event_one_agent.scenario
View file @
6c627813
{
"name" : "02_bang_event_one_agent",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -112,6 +112,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/BangEvent/scenarios/03_bang_event_multiple_agents.scenario
View file @
6c627813
{
"name" : "03_bang_event_multiple_agents",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -112,6 +112,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/BangEvent/scenarios/04_bang_event_one_agent_one_obstacle.scenario
View file @
6c627813
{
"name" : "04_bang_event_one_agent_one_obstacle",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -121,6 +121,7 @@
},
"id" : -1
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/BangEvent/scenarios/05_bang_event_narrowed_street.scenario
View file @
6c627813
{
"name" : "05_bang_event_narrowed_street",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -834,6 +834,7 @@
},
"id" : -1
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/BangEvent/scenarios/06_bang_event_guimaraes_platz.scenario
View file @
6c627813
{
"name" : "06_bang_event_guimaraes_platz",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -1086,6 +1086,7 @@
},
"id" : -1
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/01_wait_event_osm_sequential.scenario
View file @
6c627813
{
"name" : "01_wait_event_osm_sequential",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -128,6 +128,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/02_wait_event_osm_event_driven.scenario
View file @
6c627813
{
"name" : "02_wait_event_osm_event_driven",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -128,6 +128,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/03_wait_event_recurring_osm_sequential.scenario
View file @
6c627813
{
"name" : "03_wait_event_recurring_osm_sequential",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -128,6 +128,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/04_wait_in_area_event_osm_sequential.scenario
View file @
6c627813
{
"name" : "04_wait_in_area_event_osm_sequential",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -128,6 +128,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/05_wait_in_area_event_bhm.scenario
View file @
6c627813
{
"name" : "05_wait_in_area_event_bhm",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -116,6 +116,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/06_bang_event_osm_sequential.scenario
View file @
6c627813
{
"name" : "06_bang_event_osm_sequential",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -128,6 +128,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestEvents/DifferentEvents/scenarios/07_bang_event_osm_event_driven.scenario
View file @
6c627813
{
"name" : "07_bang_event_osm_event_driven",
"description" : "",
"release" : "0.7",
"commithash" : "3d1bcfd83a7d3848a4dd5baa50e802a2dce0c3e7",
"release" : "0.8",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -129,6 +128,7 @@
"bounded" : true
},
"obstacles" : [ ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
VadereModelTests/TestGNM/scenarios/basic_1_chicken_gnm1.scenario
View file @
6c627813
{
"name" : "basic_1_chicken_gnm1",
"description" : "",
"release" : "0.
7
",
"release" : "0.
8
",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
...
...
@@ -99,6 +99,7 @@
},
"id" : -1
} ],
"measurementAreas" : [ ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
...
...
Prev
1
2
3
4
5
…
15
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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