| Home | Trees | Index | Help |
|---|
| Package esys :: Package escript :: Module modelframe :: Class Simulation |
|
object --+
|
LinkableObject --+
|
ParameterSet --+
|
Model --+
|
Simulation
A Simulation object is special Model which runs a sequence of Models.
The methodsdoInitialization, finalize,
getSafeTimeStepSize, doStepPreprocessing,
terminateIteration, doStepPostprocessing,
doFinalization are executing the corresponding methods of
the models in the simulation.
| Method Summary | |
|---|---|
Initiates a simulation from a list of models. | |
Returns the i-th model. | |
Returns the number of models. | |
Returns a string representation of the Simulation. | |
Sets the i-th model. | |
Returning Simulation as a string. | |
Finalalizes the time stepping for all models. | |
Initializes all models. | |
Executes the iteration step at a time step for all model: | |
Finalalizes the iteration process for all models. | |
Initializes the time step for all models. | |
Returns True if any of the models is to be finalized. | |
fromDom(cls,
doc)
(Class method) | |
Returns a time step size which can safely be used by all models. | |
Returns an iterator over the models. | |
Run the simulation by performing essentially: | |
Returns True if all iterations for all models are terminated. | |
toDom method of Simulation class. | |
Writes the object as an XML object into an output stream. | |
| Inherited from ParameterSet | |
Removes the attribute name. | |
Creates an iterator over the parameter and their values. | |
Declares a new parameter(s) and its (their) initial value. | |
Declares a set of parameters. | |
Removes parameter name from the paramameters. | |
Returns a descrition of the parameters. | |
| Inherited from LinkableObject | |
Returns the value of attribute name. | |
Sets the value for attribute name. | |
Return the object stored for attribute name. | |
Returns True if self as attribute name. | |
If debugging is on, print the message, otherwise do nothing | |
| Inherited from object | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
| Class Variable Summary | |
|---|---|
int |
FAILED_TIME_STEPS_MAX = 20 |
int |
MAX_ITER_STEPS = 50 |
| Inherited from Model | |
float |
UNDEF_DT = 1.0000000000000001e+300 |
| Inherited from LinkableObject | |
count |
number_sequence = <itertools.count object at 0x401ff100>
|
| Instance Method Details |
|---|
__init__(self,
models=[],
**kwargs)
Initiates a simulation from a list of models.
|
__getitem__(self,
i)
Returns the i-th model.
|
__len__(self)
Returns the number of models.
|
__repr__(self)
Returns a string representation of the Simulation.
|
__setitem__(self,
i,
value)
Sets the i-th model.
|
__str__(self)
Returning Simulation as a string.
|
doFinalization(self)Finalalizes the time stepping for all models.
|
doInitialization(self)Initializes all models. |
doStep(self, dt)Executes the iteration step at a time step for all model:
self.doStepPreprocessing(dt)
while not self.terminateIteration():
for all models:
self.doStep(dt)
self.doStepPostprocessing(dt)
|
doStepPostprocessing(self, dt)Finalalizes the iteration process for all models. |
doStepPreprocessing(self, dt)Initializes the time step for all models. |
finalize(self)Returns True if any of the models is to be finalized.
|
getSafeTimeStepSize(self, dt)Returns a time step size which can safely be used by all models. This is the minimum over the time step sizes of all models. |
iterModels(self)Returns an iterator over the models. |
run(self, check_point=None)Run the simulation by performing essentially:
self.doInitialization()
while not self.finalize():
dt=self.getSafeTimeStepSize()
self.doStep(dt)
if n%check_point==0:
self.writeXML()
self.doFinalization()
If one of the models in throws a If one of the models in throws a
Simulation.FAILED_TIME_STEPS_MAX attempts.
|
terminateIteration(self)Returns True if all iterations for all models are terminated. |
toDom(self, document, node)toDom method of Simulation class.
|
writeXML(self, ostream=<epydoc.imports._DevNull instance at 0x402244cc>)Writes the object as an XML object into an output stream.
|
| Class Variable Details |
|---|
FAILED_TIME_STEPS_MAX
|
MAX_ITER_STEPS
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Apr 27 11:16:25 2006 | http://epydoc.sf.net |