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
7e29528b
Commit
7e29528b
authored
Oct 24, 2018
by
jimonreal
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Fixing extension
parent
12ca8f35
Changes
3
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
7e29528b
...
...
@@ -129,11 +129,17 @@ public class TraciSimulationController implements VehicleController, SimulationS
/*
* prevent vehicles form teleporting (http://sumo.dlr.de/wiki/Simulation/Why_Vehicles_are_teleporting)
*/
if
(
_tripOutputFile
.
contains
(
"basic"
))
{
_connection
.
addOption
(
"additional-files"
,
getAdditionalsFilename
(
"basic-additional.xml"
));
}
_connection
.
addOption
(
"time-to-teleport"
,
Integer
.
toString
(-
1
));
_connection
.
addOption
(
"tripinfo-output.write-unfinished"
,
"t"
);
String
outputTripFileName
=
getTripOutputFilename
(
_tripOutputFile
);
String
summaryFile
=
getSummaryFilename
(
_tripOutputFile
);
_connection
.
addOption
(
"tripinfo-output"
,
outputTripFileName
);
_connection
.
addOption
(
"device.emissions.probability"
,
"1.0"
);
_connection
.
addOption
(
"duration-log.statistics"
,
"t"
);
_connection
.
addOption
(
"summary"
,
summaryFile
);
_connection
.
printSumoError
(
true
);
...
...
@@ -162,6 +168,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
path
.
getParent
().
toString
()
+
"/results/"
+
filename
;
}
private
String
getAdditionalsFilename
(
String
filename
)
{
Path
path
=
Paths
.
get
(
_configFile
);
return
path
.
getParent
().
toString
()
+
"/"
+
filename
;
}
@Override
public
void
simulationFinished
()
{
/*
...
...
@@ -312,6 +323,12 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
programId
;
}
@Override
public
void
setCompleteRedYellowGreenDefinition
(
String
trafficLightId
,
SumoTLSProgram
sumoTLSProgram
)
{
SumoCommand
definitionCommand
=
Trafficlight
.
setCompleteRedYellowGreenDefinition
(
trafficLightId
,
sumoTLSProgram
);
execute
(
definitionCommand
);
}
@Override
public
String
getDefinition
(
String
trafficLightId
)
{
SumoCommand
definitionCommand
=
Trafficlight
.
getCompleteRedYellowGreenDefinition
(
trafficLightId
);
...
...
@@ -332,10 +349,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
}
@Override
public
void
getCompleteDefinition
(
String
trafficLightId
)
{
public
SumoTLSController
getCompleteDefinition
(
String
trafficLightId
)
{
SumoCommand
completeTrafficLightDefinitionCommand
=
Trafficlight
.
getCompleteRedYellowGreenDefinition
(
trafficLightId
);
Object
completeTrafficLightDefinitionObject
=
requestObject
(
completeTrafficLightDefinitionCommand
);
return
((
SumoTLSController
)
completeTrafficLightDefinitionObject
);
}
@Override
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
7e29528b
...
...
@@ -21,6 +21,8 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exce
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoExitAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLight
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLightState
;
import
de.tudresden.ws.container.SumoTLSController
;
import
de.tudresden.ws.container.SumoTLSProgram
;
public
class
XMLSimulationController
implements
VehicleController
,
SimulationSetupExtractor
,
Runnable
,
TrafficLightController
{
private
String
_vehicleDataPath
;
...
...
@@ -113,6 +115,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return
0
;
}
@Override
public
void
setCompleteRedYellowGreenDefinition
(
String
trafficLightId
,
SumoTLSProgram
sumoTLSProgram
)
{
}
public
VehicleInformationContainer
requestVehicleInformation
(
String
pVehicleID
)
{
return
_vehicleDataInformationHandler
.
getVehiclePositions
().
get
(
pVehicleID
);
}
...
...
@@ -263,8 +270,8 @@ public class XMLSimulationController implements VehicleController, SimulationSet
}
@Override
public
void
getCompleteDefinition
(
String
trafficLightId
)
{
public
SumoTLSController
getCompleteDefinition
(
String
trafficLightId
)
{
return
null
;
}
@Override
...
...
src/de/tud/kom/p2psim/impl/vehicular/trafficlights/DefaultTrafficLightInformationComponent.java
View file @
7e29528b
...
...
@@ -8,6 +8,8 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.Road
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLight
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLightInformationComponent
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLightState
;
import
de.tudresden.ws.container.SumoTLSController
;
import
de.tudresden.ws.container.SumoTLSProgram
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -92,13 +94,13 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
}
@Override
public
int
getPhase
()
{
return
controller
.
getPhase
(
t
rafficLightId
);
public
int
getPhase
(
String
pTrafficLightId
)
{
return
controller
.
getPhase
(
pT
rafficLightId
);
}
@Override
public
void
setPhase
(
int
phase
)
{
controller
.
setPhase
(
t
rafficLightId
,
phase
);
public
void
setPhase
(
String
pTrafficLightId
,
int
phase
)
{
controller
.
setPhase
(
pT
rafficLightId
,
phase
);
}
@Override
...
...
@@ -132,8 +134,8 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
}
@Override
public
void
getCompleteDefinition
(
String
trafficLightId
)
{
controller
.
getCompleteDefinition
(
trafficLightId
);
public
SumoTLSController
getCompleteDefinition
(
String
trafficLightId
)
{
return
controller
.
getCompleteDefinition
(
trafficLightId
);
}
@Override
...
...
@@ -166,6 +168,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
return
controller
.
getEdgeOccupancyRate
(
edgeIdFrom
);
}
@Override
public
void
setCompleteRedYellowGreenDefinition
(
String
trafficLightId
,
SumoTLSProgram
sumoTLSProgram
)
{
controller
.
setCompleteRedYellowGreenDefinition
(
trafficLightId
,
sumoTLSProgram
);
}
@Override
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