Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
73bb2041
Commit
73bb2041
authored
Jul 10, 2018
by
Jose Ignacio Monreal Bailey
Browse files
Integrating model and simulation.
parent
846d2e66
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
73bb2041
...
@@ -252,7 +252,26 @@ public class TraciSimulationController implements VehicleController, SimulationS
...
@@ -252,7 +252,26 @@ public class TraciSimulationController implements VehicleController, SimulationS
execute
(
phaseDurationCommand
);
execute
(
phaseDurationCommand
);
}
}
@Override
@Override
public
int
getProgramId
(
String
trafficLightId
)
{
SumoCommand
programIdCommand
=
Trafficlight
.
getProgram
(
trafficLightId
);
Object
programIdObject
=
requestObject
(
programIdCommand
);
int
programId
=
Integer
.
parseInt
((
String
)
programIdObject
);
return
programId
;
}
@Override
public
String
getDefinition
(
String
trafficLightId
)
{
SumoCommand
definitionCommand
=
Trafficlight
.
getCompleteRedYellowGreenDefinition
(
trafficLightId
);
Object
definitionObject
=
requestObject
(
definitionCommand
);
//((SumoTLSController) definitionObject).programs.get("1")
return
(
String
)
definitionObject
;
}
@Override
public
boolean
nextStep
()
{
public
boolean
nextStep
()
{
if
(
Simulator
.
getEndTime
()
==
Simulator
.
getCurrentTime
())
{
if
(
Simulator
.
getEndTime
()
==
Simulator
.
getCurrentTime
())
{
return
false
;
return
false
;
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
73bb2041
...
@@ -230,6 +230,16 @@ public class XMLSimulationController implements VehicleController, SimulationSet
...
@@ -230,6 +230,16 @@ public class XMLSimulationController implements VehicleController, SimulationSet
}
}
@Override
public
int
getProgramId
(
String
trafficLightId
)
{
return
0
;
}
@Override
public
String
getDefinition
(
String
trafficLightId
)
{
return
null
;
}
@Override
@Override
public
double
getScenarioWidth
()
{
public
double
getScenarioWidth
()
{
return
-
1
;
return
-
1
;
...
...
src/de/tud/kom/p2psim/impl/vehicular/trafficlights/DefaultTrafficLightInformationComponent.java
View file @
73bb2041
...
@@ -97,6 +97,16 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
...
@@ -97,6 +97,16 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
controller
.
setPhaseDuration
(
trafficLightId
,
extraTime
);
controller
.
setPhaseDuration
(
trafficLightId
,
extraTime
);
}
}
@Override
public
int
getProgramId
()
{
return
controller
.
getProgramId
(
trafficLightId
);
}
@Override
public
String
getDefinition
()
{
return
controller
.
getDefinition
(
trafficLightId
);
}
@Override
@Override
public
void
initialize
()
{
public
void
initialize
()
{
...
...
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