Class OTSNetworkUtils


  • public final class OTSNetworkUtils
    extends Object
    OTSNetworkCloner makes a deep clone of a network.

    Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. BSD-style license. See OpenTrafficSim License.

    Author:
    Alexander Verbraeck
    • Method Detail

      • clone

        public static OTSNetwork clone​(OTSNetwork network,
                                       String newId,
                                       OTSSimulatorInterface newSimulator)
                                throws NetworkException
        Clone the OTSNetwork.
        Parameters:
        network - OTSNetwork; the network to clone
        newId - String; the new id of the network
        newSimulator - OTSSimulatorInterface; the new simulator for this network
        Returns:
        a clone of this network
        Throws:
        NetworkException - in case the cloning fails
      • destroy

        public static void destroy​(OTSNetwork network)
        Remove all objects and animation in the network.
        Parameters:
        network - OTSNetwork; the network to destroy