View Javadoc
1   package org.opentrafficsim.demo.fd;
2   
3   import org.opentrafficsim.core.dsol.AbstractOtsModel;
4   import org.opentrafficsim.core.dsol.OtsSimulatorInterface;
5   import org.opentrafficsim.core.network.Network;
6   import org.opentrafficsim.road.network.RoadNetwork;
7   
8   import nl.tudelft.simulation.dsol.SimRuntimeException;
9   
10  /**
11   * Fundamental diagram model.
12   * <p>
13   * Copyright (c) 2020-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
14   * BSD-style license. See <a href="https://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
15   * </p>
16   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
18   * @author <a href="https://www.transport.citg.tudelft.nl">Wouter Schakel</a>
19   */
20  public class FundamentalDiagramModel extends AbstractOtsModel
21  {
22  
23      /** */
24      private static final long serialVersionUID = 20200516L;
25  
26      /** The network. */
27      private RoadNetwork network;
28  
29      /**
30       * @param simulator OtsSimulatorInterface; the simulator to use
31       */
32      public FundamentalDiagramModel(final OtsSimulatorInterface simulator)
33      {
34          super(simulator, "FD Demo", "Fundamental Diagram Demo");
35      }
36  
37      /** {@inheritDoc} */
38      @Override
39      public Network getNetwork()
40      {
41          return this.network;
42      }
43  
44      /** {@inheritDoc} */
45      @Override
46      public void constructModel() throws SimRuntimeException
47      {
48          this.network = new RoadNetwork("FdNetwork", getSimulator());
49      }
50  
51  }