package org.opentrafficsim.demo.carFollowing; import java.awt.Container; import java.awt.Frame; import java.awt.geom.Rectangle2D; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Random; import javax.naming.NamingException; import javax.swing.JPanel; import javax.swing.SwingUtilities; import nl.tudelft.simulation.dsol.SimRuntimeException; import nl.tudelft.simulation.dsol.gui.swing.TablePanel; import nl.tudelft.simulation.dsol.simulators.SimulatorInterface; import org.opentrafficsim.core.car.LaneBasedIndividualCar; import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface; import org.opentrafficsim.core.dsol.OTSModelInterface; import org.opentrafficsim.core.dsol.OTSSimTimeDouble; import org.opentrafficsim.core.geometry.OTSGeometryException; import org.opentrafficsim.core.geometry.OTSPoint3D; import org.opentrafficsim.core.gtu.GTUException; import org.opentrafficsim.core.gtu.GTUType; import org.opentrafficsim.core.gtu.animation.DefaultCarAnimation; import org.opentrafficsim.core.gtu.animation.GTUColorer; import org.opentrafficsim.core.gtu.following.GTUFollowingModel; import org.opentrafficsim.core.gtu.following.IDM; import org.opentrafficsim.core.gtu.following.IDMPlus; import org.opentrafficsim.core.gtu.lane.changing.AbstractLaneChangeModel; import org.opentrafficsim.core.gtu.lane.changing.Altruistic; import org.opentrafficsim.core.gtu.lane.changing.Egoistic; import org.opentrafficsim.core.network.NetworkException; import org.opentrafficsim.core.network.OTSNode; import org.opentrafficsim.core.network.factory.LaneFactory; import org.opentrafficsim.core.network.lane.Lane; import org.opentrafficsim.core.network.lane.LaneType; import org.opentrafficsim.core.network.route.CompleteRoute; import org.opentrafficsim.core.network.route.CompleteLaneBasedRouteNavigator; import org.opentrafficsim.core.unit.AccelerationUnit; import org.opentrafficsim.core.unit.LengthUnit; import org.opentrafficsim.core.unit.SpeedUnit; import org.opentrafficsim.core.unit.TimeUnit; import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar; import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar.Abs; import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar.Rel; import org.opentrafficsim.graphs.AccelerationContourPlot; import org.opentrafficsim.graphs.ContourPlot; import org.opentrafficsim.graphs.DensityContourPlot; import org.opentrafficsim.graphs.FlowContourPlot; import org.opentrafficsim.graphs.LaneBasedGTUSampler; import org.opentrafficsim.graphs.SpeedContourPlot; import org.opentrafficsim.graphs.TrajectoryPlot; import org.opentrafficsim.simulationengine.AbstractWrappableSimulation; import org.opentrafficsim.simulationengine.properties.AbstractProperty; import org.opentrafficsim.simulationengine.properties.BooleanProperty; import org.opentrafficsim.simulationengine.properties.CompoundProperty; import org.opentrafficsim.simulationengine.properties.ContinuousProperty; import org.opentrafficsim.simulationengine.properties.IDMPropertySet; import org.opentrafficsim.simulationengine.properties.IntegerProperty; import org.opentrafficsim.simulationengine.properties.ProbabilityDistributionProperty; import org.opentrafficsim.simulationengine.properties.PropertyException; import org.opentrafficsim.simulationengine.properties.SelectionProperty; /** * Circular road simulation demo. *

* Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License. *

* $LastChangedDate$, @version $Revision$, by $Author$, * initial version 21 nov. 2014
* @author Peter Knoppers */ public class CircularRoad extends AbstractWrappableSimulation { /** the model. */ private RoadSimulationModel model; /** Create a CircularRoad simulation. */ public CircularRoad() { this.properties.add(new SelectionProperty("Lane changing", "The lane change strategies vary in politeness.
" + "Two types are implemented: