org.jscience.architecture.traffic
Class Model

java.lang.Object
  extended by java.util.Observable
      extended by org.jscience.architecture.traffic.Model
All Implemented Interfaces:
XMLSerializable
Direct Known Subclasses:
EditModel, SimModel

public class Model
extends java.util.Observable
implements XMLSerializable

The heart of the simulation.


Field Summary
protected  Infrastructure infra
          The infrastructure used by the model
protected  java.lang.String parentName
          DOCUMENT ME!
static boolean SAVE_STATS
          Determines whether statistics are saved and loaded or not.
 
Constructor Summary
Model()
          Creates a model with an empty infrastructure
Model(Infrastructure i)
          Creates a model with the given infrastructure
 
Method Summary
 Infrastructure getInfrastructure()
          Returns the current infrastructure
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setInfrastructure(Infrastructure i)
          Sets the current infrastructure
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVE_STATS

public static boolean SAVE_STATS
Determines whether statistics are saved and loaded or not.


infra

protected Infrastructure infra
The infrastructure used by the model


parentName

protected java.lang.String parentName
DOCUMENT ME!

Constructor Detail

Model

public Model()
Creates a model with an empty infrastructure


Model

public Model(Infrastructure i)
Creates a model with the given infrastructure

Parameters:
i - DOCUMENT ME!
Method Detail

getInfrastructure

public Infrastructure getInfrastructure()
Returns the current infrastructure

Returns:
DOCUMENT ME!

setInfrastructure

public void setInfrastructure(Infrastructure i)
Sets the current infrastructure

Parameters:
i - DOCUMENT ME!

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
DOCUMENT ME!

Specified by:
load in interface XMLSerializable
Parameters:
myElement - DOCUMENT ME!
loader - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Returns:
DOCUMENT ME!

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveChilds in interface XMLSerializable
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

getXMLName

public java.lang.String getXMLName()
DOCUMENT ME!

Specified by:
getXMLName in interface XMLSerializable
Returns:
DOCUMENT ME!

setParentName

public void setParentName(java.lang.String parentName)
                   throws XMLTreeException
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!