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
fee642a0
Commit
fee642a0
authored
Sep 10, 2018
by
jimonreal
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Adding PhaseDuration
parent
f9dbe74e
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 @
fee642a0
...
@@ -268,6 +268,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
...
@@ -268,6 +268,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
execute
(
phaseDurationCommand
);
execute
(
phaseDurationCommand
);
}
}
@Override
public
double
getPhaseDuration
(
String
trafficLightId
)
{
SumoCommand
phaseDurationCommand
=
Trafficlight
.
getPhaseDuration
(
trafficLightId
);
Object
phaseDurationObject
=
requestObject
(
phaseDurationCommand
);
double
phaseDuration
=
((
int
)
phaseDurationObject
)/
1000.0
;
return
phaseDuration
;
}
@Override
@Override
public
int
getProgramId
(
String
trafficLightId
)
{
public
int
getProgramId
(
String
trafficLightId
)
{
SumoCommand
programIdCommand
=
Trafficlight
.
getProgram
(
trafficLightId
);
SumoCommand
programIdCommand
=
Trafficlight
.
getProgram
(
trafficLightId
);
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
fee642a0
...
@@ -232,6 +232,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
...
@@ -232,6 +232,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
}
}
@Override
public
double
getPhaseDuration
(
String
trafficLightId
)
{
return
0
;
}
@Override
@Override
public
int
getProgramId
(
String
trafficLightId
)
{
public
int
getProgramId
(
String
trafficLightId
)
{
return
0
;
return
0
;
...
...
src/de/tud/kom/p2psim/impl/vehicular/trafficlights/DefaultTrafficLightInformationComponent.java
View file @
fee642a0
...
@@ -107,6 +107,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
...
@@ -107,6 +107,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
controller
.
setPhaseDuration
(
trafficLightId
,
extraTime
);
controller
.
setPhaseDuration
(
trafficLightId
,
extraTime
);
}
}
@Override
public
double
getPhaseDuration
(
String
trafficLightId
)
{
return
controller
.
getPhaseDuration
(
trafficLightId
);
}
@Override
@Override
public
int
getProgramId
()
{
public
int
getProgramId
()
{
return
controller
.
getProgramId
(
trafficLightId
);
return
controller
.
getProgramId
(
trafficLightId
);
...
...
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