LILAC
|
stores a real number that is varied during the simulation More...
#include <variable.h>
Public Member Functions | |
virtual void | print () const |
virtual void | _retrieve (retrieve_wrapper &&inval, item *caller) |
virtual void | add_ref (double &in, std::shared_ptr< item > inval) |
virtual void | add_ref (double &in, item *inval) |
virtual void | copy (double *inval) |
virtual void | parse (const std::string &inval) |
virtual std::string | type () const |
virtual void | inc () |
cover funtion for variable | |
void | inc (double i) |
void | set (double v) |
Public Attributes | |
double | low_bound |
double | high_bound |
double | inc_size |
Private Attributes | |
std::map< item *, std::set < double * > > | modifiers |
std::map< std::weak_ptr< item > , std::set< double * > , std::owner_less < std::weak_ptr< item > > > | safe_mods |
Additional Inherited Members | |
![]() | |
static std::shared_ptr< item > | create (std::string name, engineimp *rval) |
![]() | |
T | value |
stores a real number that is varied during the simulation
This class stores a real number that is allowed to vary during the simulation It stores all of the values that are linked to it and updates them upon the change A method of setting a variable that does not involve linking the memory is also implemented This function does not re-implement type, as for the purposes of dependencies it is a real If one must check for being an instance of variable, the check dynamic_cast operator must be used
currently, all values are set to ge between 0 and 2*pi. Again, this is just to satisfy the CNLS situation and have a function search. The engine uses the real parser and sets the initial value to zero As the engine framework is further built, the incrementing/decrementing interface will be generalized to be useful for general pruposes, not simply plain toroidal searches
Definition at line 35 of file variable.h.
|
virtual |
This function assigns the real value stored to the value pointed at by inval. It also keeps track of the pointer and updates it whenever the variable has changed. Passing a null pointer will result in the variable not receiving updates
Reimplemented from native_tmpl< T, act_name >.
Definition at line 34 of file variable.cpp.
|
virtual |
Definition at line 42 of file variable.cpp.
|
virtual |
|
virtual |
This function copies the value without linking it to the actual variable
inval | The pointer to the double that is updated |
Definition at line 146 of file variable.cpp.
|
virtual |
cover funtion for variable
Definition at line 138 of file variable.cpp.
void variable::inc | ( | double | i | ) |
Definition at line 134 of file variable.cpp.
|
virtual |
Reimplemented from native_tmpl< T, act_name >.
Definition at line 150 of file variable.cpp.
|
virtual |
This function prints the value of the current variable
Reimplemented from item.
Definition at line 24 of file variable.cpp.
void variable::set | ( | double | p | ) |
This function increments the variable, and updates the relevant classes
Definition at line 86 of file variable.cpp.
|
virtual |
Reimplemented from native_tmpl< T, act_name >.
Definition at line 157 of file variable.cpp.
double variable::high_bound |
Definition at line 45 of file variable.h.
double variable::inc_size |
Definition at line 45 of file variable.h.
double variable::low_bound |
Definition at line 45 of file variable.h.
|
private |
Definition at line 37 of file variable.h.
|
private |
Definition at line 42 of file variable.h.