#include <AnalogDelayObject.h>
Public Member Functions | |
AnalogDelayObject (delay_t minimumDelay=1) | |
virtual | ~AnalogDelayObject () |
virtual void | setAnalogInput (double v, analog_port_id_t port=0) |
Analog input to given port. | |
virtual double | getAnalogOutput (analog_port_id_t port=0) const |
Return the analog value currently associated with the given port. | |
void | announceDelayedRead (delay_t delay) |
virtual int | advance (AdvanceInfo const &) |
Calculate the next state and output/propagate the result to succesors/outgoing objects. | |
virtual int | init (InitializeInfo *ii) |
Called during network initialization (prior to reset). | |
virtual int | reset (double dt) |
Called at the beginning of a simulation at t=0. | |
virtual int | getFieldOffset (string fieldname) |
void | advanceCycle () |
double | getCycledAnalogOutput (int delay) |
bool | isScheduledForAdvanceCycle () |
void | setAddedForAdvanceCycle () |
void | putNewCycleValues (double *val) |
int | initDistributedMode () |
Protected Attributes | |
CircularQueue< double > * | delay_queue |
delay_t | minDelay |
delay_t | maxDelay |
double | input |
double | output |
bool | addedForAdvanceCycle |
Friends | |
class | SimObjectTypeTest |
Definition at line 10 of file AnalogDelayObject.h.
AnalogDelayObject::AnalogDelayObject | ( | delay_t | minimumDelay = 1 |
) |
Definition at line 9 of file AnalogDelayObject.cpp.
References addedForAdvanceCycle, delay_queue, and maxDelay.
AnalogDelayObject::~AnalogDelayObject | ( | ) | [virtual] |
void AnalogDelayObject::setAnalogInput | ( | double | value, | |
analog_port_id_t | port = 0 | |||
) | [virtual] |
Analog input to given port.
Reimplemented from SimObject.
Definition at line 51 of file AnalogDelayObject.cpp.
References input.
double AnalogDelayObject::getAnalogOutput | ( | analog_port_id_t | port = 0 |
) | const [virtual] |
Return the analog value currently associated with the given port.
Reimplemented from SimObject.
Definition at line 56 of file AnalogDelayObject.cpp.
References delay_queue, and CircularQueue< T >::get().
void AnalogDelayObject::announceDelayedRead | ( | delay_t | delay | ) |
Definition at line 24 of file AnalogDelayObject.cpp.
References maxDelay.
Referenced by STAnalogMessageCreator::addAnalogMessage(), MTAnalogMessageCreator::addAnalogMessage(), and DistributedAnalogMessageCreator::addIncomingAnalogMessage().
int AnalogDelayObject::advance | ( | AdvanceInfo const & | ) | [virtual] |
Calculate the next state and output/propagate the result to succesors/outgoing objects.
The return value of advance contains several bits of information which can be decoded with the bit masks ADVANCEFLAG_* like ADVANCEFLAG_HASSPIKED and ADVANCEFLAG_DEACTIVATE.
Reimplemented from SimObject.
Definition at line 67 of file AnalogDelayObject.cpp.
References delay_queue, CircularQueue< T >::get(), input, output, and CircularQueue< T >::put().
int AnalogDelayObject::init | ( | InitializeInfo * | ii | ) | [virtual] |
Called during network initialization (prior to reset).
Reimplemented from SimObject.
Definition at line 30 of file AnalogDelayObject.cpp.
References delay_queue, maxDelay, minDelay, and output.
Called at the beginning of a simulation at t=0.
Reimplemented from SimObject.
Definition at line 44 of file AnalogDelayObject.cpp.
References delay_queue, output, and CircularQueue< T >::reset().
int AnalogDelayObject::getFieldOffset | ( | string | fieldname | ) | [virtual] |
void AnalogDelayObject::advanceCycle | ( | ) |
Definition at line 61 of file AnalogDelayObject.cpp.
References delay_queue, minDelay, and CircularQueue< T >::moveMark().
Definition at line 46 of file AnalogDelayObject.h.
References delay_queue, and CircularQueue< T >::getFromMark().
bool AnalogDelayObject::isScheduledForAdvanceCycle | ( | ) | [inline] |
Definition at line 53 of file AnalogDelayObject.h.
References addedForAdvanceCycle.
Referenced by MTAnalogMessageCreator::addAnalogMessage().
void AnalogDelayObject::setAddedForAdvanceCycle | ( | ) | [inline] |
Definition at line 58 of file AnalogDelayObject.h.
References addedForAdvanceCycle.
Referenced by MultiThreadSimEngine::addForAdvanceCycle().
void AnalogDelayObject::putNewCycleValues | ( | double * | val | ) | [inline] |
Definition at line 63 of file AnalogDelayObject.h.
References delay_queue, minDelay, CircularQueue< T >::moveMark(), and CircularQueue< T >::putArray().
int AnalogDelayObject::initDistributedMode | ( | ) |
friend class SimObjectTypeTest [friend] |
Definition at line 78 of file AnalogDelayObject.h.
CircularQueue<double>* AnalogDelayObject::delay_queue [protected] |
Definition at line 72 of file AnalogDelayObject.h.
Referenced by advance(), advanceCycle(), AnalogDelayObject(), getAnalogOutput(), getCycledAnalogOutput(), init(), initDistributedMode(), putNewCycleValues(), reset(), and ~AnalogDelayObject().
delay_t AnalogDelayObject::minDelay [protected] |
Definition at line 74 of file AnalogDelayObject.h.
Referenced by advanceCycle(), init(), and putNewCycleValues().
delay_t AnalogDelayObject::maxDelay [protected] |
Definition at line 76 of file AnalogDelayObject.h.
Referenced by AnalogDelayObject(), announceDelayedRead(), init(), and initDistributedMode().
double AnalogDelayObject::input [protected] |
Definition at line 79 of file AnalogDelayObject.h.
Referenced by advance(), getFieldOffset(), and setAnalogInput().
double AnalogDelayObject::output [protected] |
Definition at line 81 of file AnalogDelayObject.h.
Referenced by advance(), getFieldOffset(), init(), initDistributedMode(), and reset().
bool AnalogDelayObject::addedForAdvanceCycle [protected] |
Definition at line 83 of file AnalogDelayObject.h.
Referenced by AnalogDelayObject(), isScheduledForAdvanceCycle(), and setAddedForAdvanceCycle().