cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/ParallelSimulationsExample.java
public static void main(String[] args) {
        //IT IS MANDATORY TO DISABLE THE LOG WHEN EXECUTING PARALLEL SIMULATIONS.
        Log.disable();

        List<ParallelSimulationsExample> simulationList = new ArrayList<>(2);

        //Creates the first simulation scenario
        simulationList.add(
            new ParallelSimulationsExample("Simulation 1")
                .setHostsToCreate(4)
                .setVmsToCreate(4)
                .setCloudletsToCreate(8)
        );

        //Creates the second simulation scenario
       simulationList.add(
            new ParallelSimulationsExample("Simulation 2")
                .setHostsToCreate(4)
                .setVmsToCreate(4)
                .setCloudletsToCreate(16)
        );

        final long startTimeMilliSec = System.currentTimeMillis();
        //Uses Java 8 Streams to execute the simulation scenarios in parallel.
        // tag::parallelExecution[]
        simulationList.parallelStream().forEach(ParallelSimulationsExample::run);
        // end::parallelExecution[]

        final long finishTimeMilliSec = System.currentTimeMillis() - startTimeMilliSec;

        Log.enable();
        Log.printFormattedLine("Time to run %d simulations: %d milliseconds", simulationList.size(), finishTimeMilliSec);

        //Prints the cloudlet list of all executed simulations
        simulationList.forEach(ParallelSimulationsExample::printResults);
    }
/**
     * Creates the simulation scenarios with different configurations and execute them,
     * printing the results for each one after all simulations have finished.
     *
     * @param args
     */
Creates the simulation scenarios with different configurations and execute them,
printing the results for each one after all simulations have finished.

@param args
Creates the simulation scenarios with different configurations and execute them printing the results for each one after all simulations have finished . @param args
public static void main(String[] args) {
        Log.disable();
        List<ParallelSimulationsExample> simulationList = new ArrayList<>(2);
        simulationList.add(
            new ParallelSimulationsExample("Simulation 1")
                .setHostsToCreate(4)
                .setVmsToCreate(4)
                .setCloudletsToCreate(8)
        );
       simulationList.add(
            new ParallelSimulationsExample("Simulation 2")
                .setHostsToCreate(4)
                .setVmsToCreate(4)
                .setCloudletsToCreate(16)
        );
        final long startTimeMilliSec = System.currentTimeMillis();
        simulationList.parallelStream().forEach(ParallelSimulationsExample::run);
        final long finishTimeMilliSec = System.currentTimeMillis() - startTimeMilliSec;
        Log.enable();
        Log.printFormattedLine("Time to run %d simulations: %d milliseconds", simulationList.size(), finishTimeMilliSec);
        simulationList.forEach(ParallelSimulationsExample::printResults);
    }
public static void main ( String [ ] args ) { Log . disable ( ) ; List < ParallelSimulationsExample > simulationList = new ArrayList < > ( 2 ) ; simulationList . add ( new ParallelSimulationsExample ( "Simulation 1" ) . setHostsToCreate ( 4 ) . setVmsToCreate ( 4 ) . setCloudletsToCreate ( 8 ) ) ; simulationList . add ( new ParallelSimulationsExample ( "Simulation 2" ) . setHostsToCreate ( 4 ) . setVmsToCreate ( 4 ) . setCloudletsToCreate ( 16 ) ) ; final long startTimeMilliSec = System . currentTimeMillis ( ) ; simulationList . parallelStream ( ) . forEach ( ParallelSimulationsExample :: run ) ; final long finishTimeMilliSec = System . currentTimeMillis ( ) - startTimeMilliSec ; Log . enable ( ) ; Log . printFormattedLine ( "Time to run %d simulations: %d milliseconds" , simulationList . size ( ) , finishTimeMilliSec ) ; simulationList . forEach ( ParallelSimulationsExample :: printResults ) ; }
Creates the simulation scenarios with different configurations and execute them,
 printing the results for each one after all simulations have finished.
Creates the simulation scenarios with different configurations and execute them printing the results for each one after all simulations have finished .
//IT IS MANDATORY TO DISABLE THE LOG WHEN EXECUTING PARALLEL SIMULATIONS. //Creates the first simulation scenario //Creates the second simulation scenario //Uses Java 8 Streams to execute the simulation scenarios in parallel. // tag::parallelExecution[] // end::parallelExecution[] //Prints the cloudlet list of all executed simulations