package nl.tudelft.simulation.examples.dsol.terminal; import java.rmi.RemoteException; import javax.naming.NamingException; import nl.tudelft.simulation.dsol.SimRuntimeException; import nl.tudelft.simulation.dsol.experiment.Replication; import nl.tudelft.simulation.dsol.experiment.ReplicationMode; import nl.tudelft.simulation.dsol.model.inputparameters.InputParameterException; import nl.tudelft.simulation.dsol.model.inputparameters.InputParameterInteger; import nl.tudelft.simulation.dsol.model.inputparameters.InputParameterMap; import nl.tudelft.simulation.dsol.simulators.DEVSSimulator; import nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface; import org.djutils.event.EventInterface; import org.djutils.event.EventListenerInterface; import nl.tudelft.simulation.jstats.streams.MersenneTwister; /** *
* Copyright (c) 2002-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information https://simulation.tudelft.nl. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * * https://simulation.tudelft.nl/dsol/3.0/license.html. *
* @author Peter Jacobs * @author Alexander Verbraeck */ public final class ExperimentRunnerTerminal implements EventListenerInterface { /** */ private static final long serialVersionUID = 1L; /** number of running simulations. */ private int numruns = 0; /** number of completed simulations. */ private int completed = 0; /** number of runs. */ private static final int REPS = 100; /** number of runs. */ private static final int RUNS = 3 * 4 * REPS; /** * Construct the terminal experiment. * @throws SimRuntimeException on error * @throws RemoteException on error * @throws NamingException on error * @throws InputParameterException on error */ private ExperimentRunnerTerminal() throws SimRuntimeException, RemoteException, NamingException, InputParameterException { long seed = 1; int maxConcurrent = 8; for (int numQC = 4; numQC <= 6; numQC++) { for (int numAGV = 25; numAGV <= 28; numAGV++) { for (int rep = 1; rep <= REPS; rep++) { while (this.numruns > maxConcurrent) { try { Thread.sleep(1); } catch (InterruptedException exception) { // } } double runtime = 40 * 60; DEVSSimulator.TimeDouble simulator = new DEVSSimulator.TimeDouble("ExperimentRunnerTerminal"); Terminal model = new Terminal(simulator, rep); Replication.TimeDouble