Class OTSRoadNetworkUtils


  • public final class OTSRoadNetworkUtils
    extends Object
    OTSRoadNetworkCloner makes a deep clone of a network.

    Copyright (c) 2003-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
    Author:
    Alexander Verbraeck
    • Method Detail

      • clone

        public static OTSRoadNetwork clone​(OTSRoadNetwork network,
                                           String newId,
                                           OTSSimulatorInterface oldSimulator,
                                           OTSSimulatorInterface newSimulator)
                                    throws NetworkException
        Clone the OTSRoadNetwork.
        Parameters:
        network - OTSRoadNetwork; the network to clone
        newId - String; the new id of the network
        oldSimulator - OTSSimulatorInterface; the old simulator for this 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​(OTSRoadNetwork network,
                                   OTSSimulatorInterface simulator)
        Remove all objects and animation in the road network.
        Parameters:
        network - OTSRoadNetwork; the network to destroy
        simulator - OTSSimulatorInterface; the simulator of the old network