jplus-0.4.6
yacts Class Reference

YACTS -- yet another continuous time simulator. More...

#include <src/yacts.h>

Inheritance diagram for yacts:
Collaboration diagram for yacts:

Public Member Functions

 yacts ()
 Initializes YACTS.
bool init (std::istream &script)
 Load YACTS script.
 ~yacts ()
 Frees YACTS memory.
virtual void libInit ()
 Initializes YACTS library functions and makes them avaliable to J.
bool setOut (std::string newOut)
 Sets the name of output variable.
int REPL ()
 Enters read(stdin)-eval-print(stdout) loop until the end of stdin.
std::string getTrajectoryFilenameBase (std::string prefix)
 Computes trajectory filename base, using hash of "important" parts of yacts script.
bool initTrajectory (std::string prefix)
 Initializes ODE solver and the state either from the start of the problem or from the last saved trajectory frame.
int size ()
 Returns the number of computed frames in the current trajectory file.
bool setFrame (int iframe)
 Sets specified frame as "current", loads it.
bool hasNextFrameStored ()
 Returns true if the next frame is already in the trajectory file and does not have to be (and will not be) calculated.
bool nextFrame ()
 Advances to the next trajectory frame by computing it (if necessary) and saving (if computed).
std::string process ()
 Computes and returns the "OUT" variable, corresponding to the current frame.

Friends

int runTests ()

Detailed Description

YACTS -- yet another continuous time simulator.

It uses J+ to specify a system of ODEs and Sundials library to solve them.


Constructor & Destructor Documentation

Initializes YACTS.

Frees YACTS memory.


Member Function Documentation

std::string yacts::getTrajectoryFilenameBase ( std::string  prefix)

Computes trajectory filename base, using hash of "important" parts of yacts script.

Parameters:
prefixtrajectory filename prefix.
Returns:
trajectory filename base (without extension).

Returns true if the next frame is already in the trajectory file and does not have to be (and will not be) calculated.

Returns:
"true" if the next frame is in trajectory
bool yacts::init ( std::istream &  script)

Load YACTS script.

The script must define the following variables: T, double scalar -- initial(first assignment), current and next frame time; S, double array -- initial(first assignment) and current state; dSdT, double array -- time derivative of state; OUT, character vector -- textual rendering of the current state.

Parameters:
scriptstream to load YACTS script from.

Reimplemented from jplus.

bool yacts::initTrajectory ( std::string  prefix)

Initializes ODE solver and the state either from the start of the problem or from the last saved trajectory frame.

Parameters:
prefixtrajectory filename prefix.
Returns:
true upon success.
virtual void yacts::libInit ( ) [virtual]

Initializes YACTS library functions and makes them avaliable to J.

Reimplemented from jplus.

bool yacts::nextFrame ( )

Advances to the next trajectory frame by computing it (if necessary) and saving (if computed).

Returns:
"true" if all is ok.
std::string yacts::process ( )

Computes and returns the "OUT" variable, corresponding to the current frame.

Returns:
the computed output.
int yacts::REPL ( )

Enters read(stdin)-eval-print(stdout) loop until the end of stdin.

Returns:
0.
bool yacts::setFrame ( int  iframe)

Sets specified frame as "current", loads it.

Parameters:
iframeindex of the frame to become current.
Returns:
"true" upon success.
bool yacts::setOut ( std::string  newOut)

Sets the name of output variable.

Parameters:
newOutnew output variable name.
Returns:
"true" if success (the name was OK)
int yacts::size ( )

Returns the number of computed frames in the current trajectory file.

Returns:
number of frames in the trajectory

Reimplemented from trjfile.


Friends And Related Function Documentation

int runTests ( ) [friend]

The documentation for this class was generated from the following file: