Package jasi.sim.basic

Basic simulation management.

See:
          Description

Class Summary
AbstractSimArchive Base class for all simulation archives.
AbstractSimKernel Basic implementation of a simulation kernel based on the singleton design pattern.
SimProxy Proxy manager for observers/listeners of simulation state changes.
 

Exception Summary
CouldNotCreateObjectException An element could not be created.
SimulationAlreadyRunningException A simulation is already running.
SimulationException Exception during simulation.
 

Package jasi.sim.basic Description

Basic simulation management.

This package provides an abstract simulation kernel and utility classes for basic simulation management.

A simulation kernel application is created by extension of the SimKernel class and implementing a run-method like this:

Time end = ...;
Time current = startSimulation();
try {
    while (isRunning()) {
        if (current.isGE(end)) {
            break; // The requested end time has been reached
        }
        current = continueSimulation(current, end);
    }
} finally {
    finishSimulation();
}

The simulation thread can be started and finished in the following way:

sim.start();
try {
    sim.join();
} catch (InterruptedException e) {
    System.err.println(e);
} finally {
    sim.writeArchive();
}