FSMSADF::MPExploreBindingAware::State Class Reference
#include <mpexplore_binding_aware.h>
Public Member Functions | |
State (SGraph *G, bool allocateMemory) | |
State (size_t sz, bool allocateMemory) | |
~State () | |
State * | copy () |
MPTime | consume (Scenario *s, Port *p) |
void | produce (Scenario *s, Port *p, MPTime t) |
bool | actorEnabled (SGraph *G, Actor *a) |
size_t | hashValue () const |
bool | equals (const State *s) const |
int | compare (const State *s) const |
State * | minus (State *v) const |
void | add (double factor, State *v) |
Token * | firstToken () |
MPDelay | normalize () |
MPTime | norm () |
void | smooth (State *y) |
MaxPlus::Vector * | asVector () |
uint | getPosStaticOrderSchedule (Processor *p) const |
void | setPosStaticOrderSchedule (Processor *p, uint pos) |
Static Public Member Functions | |
static State * | zeroState (SGraph *G) |
static State * | fromVector (SGraph *G, MaxPlus::Vector *v) |
static State * | zeroScheduleState (SGraph *G) |
Private Member Functions | |
void | initFifos (size_t sz, bool allocateMemory) |
void | initSchedules (SGraph *G) |
Private Attributes | |
vector< TokenFIFO * > | fifos |
map< Processor *, uint > | posStaticOrderSchedules |
Detailed Description
class State State represents a distribution of timestamped tokens over the channels of the graph.
Constructor & Destructor Documentation
FSMSADF::MPExploreBindingAware::State::State | ( | SGraph * | G, | |
bool | allocateMemory | |||
) |
State() Constructor.
References FSMSADF::ScenarioGraph::getChannels(), initFifos(), initSchedules(), and FSMSADF::MPExploreBindingAware::SGraph::scenarioGraph.
Referenced by copy(), and minus().
FSMSADF::MPExploreBindingAware::State::State | ( | size_t | sz, | |
bool | allocateMemory | |||
) |
Member Function Documentation
actorEnabled() The function returns true when the actor is enabled (i.e. ready to fire). Otherwise the function returns false.
void FSMSADF::MPExploreBindingAware::State::add | ( | double | factor, | |
State * | v | |||
) |
add() The function performs a add operation on all FIFOs.
References FSMSADF::MPExploreBindingAware::TokenFIFO::add(), and fifos.
MaxPlus::Vector * FSMSADF::MPExploreBindingAware::State::asVector | ( | void | ) |
asVector() The function returns the token production times as a MaxPlus vector.
References fifos.
int FSMSADF::MPExploreBindingAware::State::compare | ( | const State * | s | ) | const |
compare() The function implements a comparison to generate a total order for MS hash_set return -1 if receiver smaller than s, 0 if equal, otherwise 1 performs a lexicographical order on all FIFOs.
References c, FSMSADF::Port::getChannel(), FSMSADF::GraphComponent::getId(), FSMSADF::Port::getRateOfScenario(), and FSMSADF::MPExploreBindingAware::TokenFIFO::removeFirstN().
State * FSMSADF::MPExploreBindingAware::State::copy | ( | ) |
copy() The function returns a copy of this state.
References fifos, posStaticOrderSchedules, and State().
bool FSMSADF::MPExploreBindingAware::State::equals | ( | const State * | s | ) | const |
equal() The function performs an equals operation on all FIFOs.
References fifos, and posStaticOrderSchedules.
Referenced by FSMSADF::MPExploreBindingAware::StateComparator::operator()().
Token * FSMSADF::MPExploreBindingAware::State::firstToken | ( | ) |
firstToken() The function returns a pointer to the first token in any of the FIFOs. When all FIFOs are empty, the function returns NULL.
State * FSMSADF::MPExploreBindingAware::State::fromVector | ( | SGraph * | G, | |
MaxPlus::Vector * | v | |||
) | [static] |
fromVector() Initialize this state as an initial state (i.e. channels contains only initial tokens and no time has passed so far). The production times of the initial tokens are taken from the vector v.
getPosStaticOrderSchedule() The function returns the position of the static-order schedule of processor p in this state.
size_t FSMSADF::MPExploreBindingAware::State::hashValue | ( | ) | const |
hashValue() The function returns a hash value for this state.
References fifos.
Referenced by FSMSADF::MPExploreBindingAware::StateHasher::operator()().
void FSMSADF::MPExploreBindingAware::State::initFifos | ( | size_t | sz, | |
bool | allocateMemory | |||
) | [private] |
void FSMSADF::MPExploreBindingAware::State::initSchedules | ( | SGraph * | G | ) | [private] |
initSchedules() Initialize the schedules.
References FSMSADF::MPExploreBindingAware::SGraph::bindingProperties, FSMSADF::BindingAwareGraph::BindingAwareProperties::processorToStaticOrderSchedule, and setPosStaticOrderSchedule().
Referenced by State().
minus() The function performs a minus operation on all FIFOs.
References fifos, FSMSADF::MPExploreBindingAware::TokenFIFO::minus(), and State().
MPTime FSMSADF::MPExploreBindingAware::State::norm | ( | ) |
norm() The function returns the norm of the token production times.
References fifos, and MaxPlus::MP_MAX().
Referenced by normalize().
MPDelay FSMSADF::MPExploreBindingAware::State::normalize | ( | ) |
normalize() The function normalizes the production time of the tokens in all FIFOs.
References FSMSADF::MPExploreBindingAware::TokenFIFO::append(), c, FSMSADF::Port::getChannel(), FSMSADF::GraphComponent::getId(), and FSMSADF::Port::getRateOfScenario().
setPosStaticOrderSchedule() The function sets the position of the static-order schedule of processor p in this state.
Referenced by initSchedules().
void FSMSADF::MPExploreBindingAware::State::smooth | ( | State * | y | ) |
zeroScheduleState() Initialize this state (i.e. channels contains only initial tokens). The production times of the initial tokens are equal to a counter which is raised on each initial tokens that is placed in a FIFO.
zeroState() Initialize this state as an initial state (i.e. channels contains only initial tokens and no time has passed so far).
Member Data Documentation
vector<TokenFIFO*> FSMSADF::MPExploreBindingAware::State::fifos [private] |
Referenced by add(), asVector(), copy(), equals(), hashValue(), initFifos(), minus(), norm(), normalize(), smooth(), and ~State().
map<Processor*, uint> FSMSADF::MPExploreBindingAware::State::posStaticOrderSchedules [private] |
The documentation for this class was generated from the following files: