package org.opentrafficsim.demo.fd; import java.io.Serializable; import org.opentrafficsim.core.dsol.AbstractOTSModel; import org.opentrafficsim.core.dsol.OTSSimulatorInterface; import org.opentrafficsim.core.network.OTSNetwork; import org.opentrafficsim.road.network.OTSRoadNetwork; import nl.tudelft.simulation.dsol.SimRuntimeException; /** * Fundamental diagram model. *

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

* @author Alexander Verbraeck * @author Peter Knoppers * @author Wouter Schakel */ public class FundamentalDiagramModel extends AbstractOTSModel { /** */ private static final long serialVersionUID = 20200516L; /** The network. */ private OTSRoadNetwork network; /** * @param simulator OTSSimulatorInterface; the simulator to use */ public FundamentalDiagramModel(final OTSSimulatorInterface simulator) { super(simulator, "FD Demo", "Fundamental Diagram Demo"); } /** {@inheritDoc} */ @Override public OTSNetwork getNetwork() { return this.network; } /** {@inheritDoc} */ @Override public void constructModel() throws SimRuntimeException { this.network = new OTSRoadNetwork("FdNetwork", true, getSimulator()); } /** {@inheritDoc} */ @Override public Serializable getSourceId() { return "FdDemo"; } }