Interface OTSSimulatorInterface

    • Method Detail

      • initialize

        void initialize​(OTSModelInterface model,
                        OTSReplication replication)
                 throws SimRuntimeException
        Initialize a simulation engine without animation; the easy way. PauseOnError is set to true;
        Parameters:
        model - OTSModelInterface; the simulation to execute
        replication - OTSReplication; the replication with the run control parameters
        Throws:
        SimRuntimeException - when e.g., warmupPeriod is larger than runLength
      • scheduleEvent

        SimEvent<SimTimeDoubleUnit> scheduleEvent​(Time executionTime,
                                                  short priority,
                                                  Object source,
                                                  Object target,
                                                  String method,
                                                  Object[] args)
                                           throws SimRuntimeException
        Construct and schedule a SimEvent using a Time to specify the execution time.
        Parameters:
        executionTime - Time; the time at which the event must happen
        priority - short; should be between SimEventInterface.MAX_PRIORITY and SimEventInterface.MIN_PRIORITY; most normal events should use SimEventInterface.NORMAL_PRIORITY
        source - Object; the object that creates/schedules the event
        target - Object; the object that must execute the event
        method - String; the name of the method of target that must execute the event
        args - Object[]; the arguments of the method that must execute the event
        Returns:
        SimEvent<SimTimeDoubleUnit>; the event that was scheduled (the caller should save this if a need to cancel the event may arise later)
        Throws:
        SimRuntimeException - when the executionTime is in the past