@@ -0,0 +1,2407 @@
+/*%0A * JaamSim Discrete Event Simulation%0A * Copyright (C) 2021 JaamSim Software Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.jaamsim.basicsim;%0A%0A/**%0A * An individual run for a simulation model.%0A * @author Harry King%0A *%0A */%0Apublic class SimRun implements RunListener %7B%0A%0A%09private final int scenarioNumber;     // scenario number%0A%09private final int replicationNumber;  // replication number%0A%09private JaamSimModel simModel;        // simulation model to be executed%0A%09private final RunListener listener;   // listens for the end of the run%0A%0A%09/**%0A%09 * Constructs a SimRun object for the given scenario and replications numbers.%0A%09 * @param scene - scenario number for the run%0A%09 * @param rep - replication number for the run%0A%09 * @param l - listens for the end of the run%0A%09 */%0A%09public SimRun(int scene, int rep, RunListener l) %7B%0A%09%09scenarioNumber = scene;%0A%09%09replicationNumber = rep;%0A%09%09listener = l;%0A%09%7D%0A%0A%09/**%0A%09 * Sets the JaamSimModel to be executed for the run.%0A%09 * The model must be configured already and may have been used for a previous run.%0A%09 * @param model - pre-configured simulation model%0A%09 */%0A%09public void setJaamSimModel(JaamSimModel model) %7B%0A%09%09simModel = model;%0A%09%7D%0A%0A%09public JaamSimModel getJaamSimModel() %7B%0A%09%09return simModel;%0A%09%7D%0A%0A%09public int getScenarioNumber() %7B%0A%09%09return scenarioNumber;%0A%09%7D%0A%0A%09public int getReplicationNumber() %7B%0A%09%09return replicationNumber;%0A%09%7D%0A%0A%09/**%0A%09 * Starts the simulation run on a new thread.%0A%09 */%0A%09public void start(double pauseTime) %7B%0A%0A%09%09// Reset the scenario and replication numbers%0A%09%09simModel.setScenarioNumber(scenarioNumber);%0A%09%09simModel.setReplicationNumber(replicationNumber);%0A%0A%09%09// Clear the model prior to the next run%0A%09%09simModel.getEventManager().clear();%0A%09%09simModel.killGeneratedEntities();%0A%0A%09%09// Start the run%0A%09%09simModel.setRunListener(this);%0A%09%09simModel.start(pauseTime);%0A%09%7D%0A%0A%09@Override%0A%09public void runEnded() %7B%0A%09%09listener.runEnded();%0A%09%7D%0A%0A%7D%0A

add class 'SimRun'