A1: Running a solution

Top  Previous  Next

Solution: Task 1

Go to simplace_modules/runs/net/simplace/sim/runs/training/WorkingWithSolutions and create there a new class with class name 'RunSecondSolution.java' with the following content:

 

 

public class RunSecondSolution extends ModulesStandardRun

{

 public static void main(String[] args)

   {

         String tSolutionName = "02_StartEndDates";

 

         String tSolutionFileName = "${_WORKDIR_}/training/solution/1_WorkingWithSolutions/"+tSolutionName+".sol.xml";

 

         setUp();

 

         showMessage("Starting: "+tSolutionName);

         runSimulation(tSolutionFileName);

         showMessage("Finished Run: "+tSolutionName);

 

         exit();

   }

}

 

Solution: Task 2

Go to simplace_modules/runs/net/simplace/sim/runs/training/WorkingWithSolutions and create there a new class with class name 'RunSecondSolution.java' with the following content:

 

 

public class RunSecondSolution extends ModulesStandardRun

{

 public static void main(String[] args)

 {

         String tSolutionFileName1 = "${_WORKDIR_}/training/solution/1_WorkingWithSolutions/"+tSolutionName+".sol.xml";

 

         setUp();

         showMessage("Starting Simple Solution 1.");

         runSimulation(tSolutionFileName1, null);

         showMessage("Finished Run  Simple Solution 1.");

         

         

         String tSolutionFileName2 = "${_WORKDIR_}/training/solution/1_WorkingWithSolutions/02_StartEndDates.sol.xml";

         

         setUp();

         showMessage("Starting Simple Solution 2.");

         runSimulation(tSolutionFileName2, null);

         showMessage("Finished Run  Simple Solution 2.");

 

         

 }

}

 

If you would like to run the RunSecondSolution, right click on the RunSecondSolution file and choose Run As->Java Application, if you are using Eclipse look at the Console;

then go to the lap/output/training folder and check out the results in the simple2.txt file; if there are some errors ensure yourself that you don't have any mistakes in your code(in the class).