Class TrafCodDemo2

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class TrafCodDemo2 extends OtsSimulationApplication<TrafCodDemo2.TrafCodModel>

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

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • TrafCodDemo2

      public TrafCodDemo2(String title, OtsAnimationPanel panel, TrafCodDemo2.TrafCodModel model) throws org.opentrafficsim.draw.OtsDrawingException
      Create a Trafcod demo.
      Parameters:
      title - String; the title of the Frame
      panel - OtsAnimationPanel; the tabbed panel to display
      model - TrafCODModel; the model
      Throws:
      org.opentrafficsim.draw.OtsDrawingException - on animation error
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Main program.
      Parameters:
      args - String[]; the command line arguments (not used)
      Throws:
      IOException - ...
    • readStringFromURL

      public static String readStringFromURL(URL url) throws IOException
      Open an URL, read it and store the contents in a string. Adapted from https://stackoverflow.com/questions/4328711/read-url-to-string-in-few-lines-of-java-code
      Parameters:
      url - URL; the URL
      Returns:
      String
      Throws:
      IOException - when reading the file fails
    • demo

      public static void demo(boolean exitOnClose) throws IOException
      Start the demo.
      Parameters:
      exitOnClose - boolean; when running stand-alone: true; when running as part of a demo: false
      Throws:
      IOException - when reading the file fails
    • addTabs

      protected final void addTabs()
      Add tabs with trafCOD status display.
      Overrides:
      addTabs in class OtsSimulationApplication<TrafCodDemo2.TrafCodModel>