File |
Line |
org\opentrafficsim\aimsun\AimsunControl.java |
177 |
org\opentrafficsim\aimsun\AimsunControl.java |
277 |
Time stopTime = simulator.getSimulatorTime();
// System.err.println("Entering sendGTUPositionsToAimsun: simulator time is " + stopTime);
AimsunControlProtoBuf.GTUPositions.Builder builder = AimsunControlProtoBuf.GTUPositions.newBuilder();
for (GTU gtu : this.model.getNetwork().getGTUs())
{
AimsunControlProtoBuf.GTUPositions.GTUPosition.Builder gpb =
AimsunControlProtoBuf.GTUPositions.GTUPosition.newBuilder();
gpb.setGtuId(gtu.getId());
DirectedPoint dp;
try
{
dp = gtu.getOperationalPlan().getLocation(stopTime);
gpb.setX(dp.x);
gpb.setY(dp.y);
gpb.setZ(dp.z);
gpb.setAngle(dp.getRotZ());
gpb.setLength(gtu.getLength().si);
gpb.setWidth(gtu.getWidth().si);
gpb.setGtuTypeId(Integer.parseInt(gtu.getGTUType().getId().split("\\.")[1]));
gpb.setSpeed(gtu.getSpeed().si);
builder.addGtuPos(gpb.build());
}
catch (OperationalPlanException exception)
{
exception.printStackTrace();
}
}
builder.setStatus("OK"); |
File |
Line |
org\opentrafficsim\aimsun\AimsunControl.java |
582 |
org\opentrafficsim\aimsun\LoadXML.java |
183 |
this.network = new OTSRoadNetwork(getShortName(), true);
try
{
XmlNetworkLaneParser.build(new ByteArrayInputStream(this.xml.getBytes(StandardCharsets.UTF_8)), this.network,
getSimulator());
// TODO: These links are Aimsun specific.
LaneCombinationList ignoreList = new LaneCombinationList();
ignoreList.addLinkCombination((CrossSectionLink) this.network.getLink("928_J5"),
(CrossSectionLink) this.network.getLink("928_J6"));
ignoreList.addLinkCombination((CrossSectionLink) this.network.getLink("925_J1"),
(CrossSectionLink) this.network.getLink("925_J2"));
LaneCombinationList permittedList = new LaneCombinationList();
ConflictBuilder.buildConflicts(this.network, this.network.getGtuType(GTUType.DEFAULTS.VEHICLE), getSimulator(),
new ConflictBuilder.FixedWidthGenerator(Length.instantiateSI(2.0)), ignoreList, permittedList);
new GTUDumper(simulator, Time.ZERO, Duration.instantiateSI(60), network, "C:/Temp/aimsun"); |