Package desmoj.core.simulator

Examples of desmoj.core.simulator.Experiment


   */
  public static void main(java.lang.String[] args) {
    long start = System.currentTimeMillis();
    // create model and experiment
    InterruptsExample model = new InterruptsExample(null, "InterruptsExample", true, true);
    Experiment exp = new Experiment("InterruptsExampleExperiment", TimeUnit.SECONDS, TimeUnit.MINUTES, null);

    // connect both
    model.connectToExperiment(exp);

    // set experiment parameters
    exp.setShowProgressBar(true); // display a progress bar (or not)
    exp.stop(new TimeInstant(1500, TimeUnit.MINUTES)); // set end of
                              // simulation at
                              // 1500 minutes
    exp.tracePeriod(new TimeInstant(0), new TimeInstant(100, TimeUnit.MINUTES)); // set
                                            // the
                                            // period
                                            // of
                                            // the
                                            // trace
    exp.debugPeriod(new TimeInstant(0), new TimeInstant(50, TimeUnit.MINUTES)); // and
                                          // debug
                                          // output
    // ATTENTION!
    // Don't use too long periods. Otherwise a huge HTML page will
    // be created which crashes Netscape :-)

    // start the Experiment at simulation time 0.0
    exp.start();

    // --> now the simulation is running until it reaches its end criterium
    // ...
    // ...
    // <-- afterwards, the main thread returns here

    // generate the report (and other output files)
    exp.report();

    // stop all threads still alive and close all output files
    exp.finish();
  }
View Full Code Here


public class MessageCrossbarExample extends Model {

  public static void main(java.lang.String[] args) {
    MessageCrossbarExample model = new MessageCrossbarExample(null, "MessageCrossbarExample", true, true);
    Experiment exp = new Experiment("MessageCrossbarExampleExperiment", TimeUnit.SECONDS, TimeUnit.MINUTES, null);

    model.connectToExperiment(exp);

    exp.setShowProgressBar(false);
    exp.stop(new TimeInstant(1440, TimeUnit.MINUTES));
    exp.tracePeriod(new TimeInstant(0), new TimeInstant(100, TimeUnit.MINUTES));
    exp.debugPeriod(new TimeInstant(0), new TimeInstant(50, TimeUnit.MINUTES));

    exp.start();
    exp.report();
    exp.finish();
  }
View Full Code Here

    // create model and experiment
    NewConnectionExample model = new NewConnectionExample(null, "VerkettungsExample", true, true);
    // null as first parameter because it is the main model and has no
    // mastermodel

    Experiment exp = new Experiment("VerkettungsExampleExperiment", TimeUnit.SECONDS, TimeUnit.MINUTES, null);
    // ATTENTION, since the name of the experiment is used in the names of
    // the
    // output files, you have to specify a string that's compatible with the
    // filename constraints of your computer's operating system. The remaing
    // three
    // parameters specify the granularity of simulation time, default unit
    // to
    // display time and the time formatter to use (null yields a default
    // formatter).
    // connect both
    model.connectToExperiment(exp);

    // set experiment parameters
    exp.setShowProgressBar(false); // display a progress bar (or not)
    exp.stop(new TimeInstant(100, TimeUnit.MINUTES)); // set end of
                              // simulation at
                              // 1500 minutes
    exp.tracePeriod(new TimeInstant(0), new TimeInstant(100, TimeUnit.MINUTES)); // set
                                            // the
                                            // period
                                            // of
                                            // the
                                            // trace
    exp.debugPeriod(new TimeInstant(0), new TimeInstant(50, TimeUnit.MINUTES)); // and
                                          // debug
                                          // output
    // ATTENTION!
    // Don't use too long periods. Otherwise a huge HTML page will
    // be created which crashes Netscape :-)

    // start the experiment at simulation time 0.0
    exp.start();

    // --> now the simulation is running until it reaches its end criterion
    // ...
    // ...
    // <-- afterwards, the main thread returns here

    // generate the report (and other output files)
    exp.report();

    // stop all threads still alive and close all output files
    exp.finish();
  }
View Full Code Here

      public void init() {

      }
    };

    owner.connectToExperiment(new Experiment("TestExperiment"));
  }
View Full Code Here

    // create model and experiment
    ObserverExample model = new ObserverExample(null, "ObserverExample", true, true);
    // null as first parameter because it is the main model and has no
    // mastermodel

    Experiment exp = new Experiment("ObserverExampleExperiment", TimeUnit.SECONDS, TimeUnit.MINUTES, null);
    // ATTENTION, since the name of the experiment is used in the names of
    // the
    // output files, you have to specify a string that's compatible with the
    // filename constraints of your computer's operating system. The remaing
    // three
    // parameters specify the granularity of simulation time, default unit
    // to
    // display time and the time formatter to use (null yields a default
    // formatter).
    // connect both
    model.connectToExperiment(exp);

    // set experiment parameters
    exp.setShowProgressBar(true); // display a progress bar (or not)
    exp.stop(new TimeInstant(150000, TimeUnit.MINUTES)); // set end of
                                // simulation at
                                // 1500 minutes
    exp.tracePeriod(new TimeInstant(0), new TimeInstant(100, TimeUnit.MINUTES)); // set
                                            // the
                                            // period
                                            // of
                                            // the
                                            // trace
    exp.debugPeriod(new TimeInstant(0), new TimeInstant(50, TimeUnit.MINUTES)); // and
                                          // debug
                                          // output
    // ATTENTION!
    // Don't use too long periods. Otherwise a huge HTML page will
    // be created which crashes Netscape :-)

    // start the experiment at simulation time 0.0
    exp.start();

    // --> now the simulation is running until it reaches its end criterion
    // ...
    // ...
    // <-- afterwards, the main thread returns here

    // generate the report (and other output files)
    exp.report();

    // stop all threads still alive and close all output files
    exp.finish();
  }
View Full Code Here

TOP

Related Classes of desmoj.core.simulator.Experiment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.