FSMSADF::MPExplore::State Class Reference
#include <mpexplore.h>
Public Member Functions | |
State (SGraph *G) | |
State (size_t sz) | |
~State () | |
State * | copy () |
MPTime | consume (Scenario *s, Port *p) |
void | produce (Scenario *s, Port *p, MPTime t) |
bool | actorEnabled (Scenario *s, 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 () |
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 | init (size_t sz) |
Private Attributes | |
MPTime | timestamp |
vector< TokenFIFO * > | table |
Detailed Description
class State State represents a distribution of timestamped tokens over the channels of the graph.
Constructor & Destructor Documentation
FSMSADF::MPExplore::State::State | ( | SGraph * | G | ) |
State() Constructor.
References FSMSADF::ScenarioGraph::getChannels(), init(), and FSMSADF::MPExplore::SGraph::scenarioGraph.
Referenced by copy(), fromVector(), minus(), zeroScheduleState(), and zeroState().
FSMSADF::MPExplore::State::State | ( | size_t | sz | ) |
Member Function Documentation
actorEnabled() The function returns true when the actor is enabled (i.e. ready to fire). Otherwise the function returns false.
References FSMSADF::Port::getChannel(), FSMSADF::GraphComponent::getId(), FSMSADF::Actor::getPorts(), FSMSADF::Port::getRateOfScenario(), FSMSADF::Port::getType(), and table.
Referenced by FSMSADF::MPExplore::Exploration::exploreDelayForSchedule(), and FSMSADF::MPExplore::Exploration::exploreEigen().
void FSMSADF::MPExplore::State::add | ( | double | factor, | |
State * | v | |||
) |
add() The function performs a add operation on all FIFOs.
References FSMSADF::MPExplore::TokenFIFO::add(), and table.
MaxPlus::Vector * FSMSADF::MPExplore::State::asVector | ( | void | ) |
asVector() The function returns the token production times as a MaxPlus vector.
Referenced by FSMSADF::MPExplore::Exploration::exploreEigen().
int FSMSADF::MPExplore::State::compare | ( | const State * | s | ) | const |
References c, FSMSADF::Port::getChannel(), FSMSADF::GraphComponent::getId(), FSMSADF::Port::getRateOfScenario(), and FSMSADF::MPExplore::TokenFIFO::removeFirstN().
Referenced by FSMSADF::MPExplore::SGraph::fire().
State * FSMSADF::MPExplore::State::copy | ( | ) |
copy() The function returns a copy of this state.
References State(), table, and timestamp.
Referenced by FSMSADF::MPExplore::Exploration::exploreDelayForSchedule(), and FSMSADF::MPExplore::Exploration::exploreEigen().
bool FSMSADF::MPExplore::State::equals | ( | const State * | s | ) | const |
equals() The function performs an equals operation on all FIFOs.
References table.
Referenced by FSMSADF::MPExplore::Exploration::exploreEigen(), and FSMSADF::MPExplore::StateComparator::operator()().
Token * FSMSADF::MPExplore::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.
References FSMSADF::MPExplore::TokenFIFO::first(), FSMSADF::MPExplore::TokenFIFO::size(), and table.
State * FSMSADF::MPExplore::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.
References c, MaxPlus::Vector::get(), FSMSADF::ScenarioGraph::getChannels(), FSMSADF::GraphComponent::getId(), FSMSADF::Channel::getInitialTokens(), FSMSADF::MPExplore::SGraph::scenarioGraph, State(), FSMSADF::MPExplore::SGraph::synchStorage, table, timestamp, and TokenFIFO.
Referenced by FSMSADF::MPExplore::Exploration::exploreDelayForSchedule().
size_t FSMSADF::MPExplore::State::hashValue | ( | ) | const |
hashValue() The function returns a hash value for this state.
References table.
Referenced by FSMSADF::MPExplore::StateHasher::operator()().
void FSMSADF::MPExplore::State::init | ( | size_t | sz | ) | [private] |
minus() The function performs a minus operation on all FIFOs.
References FSMSADF::MPExplore::TokenFIFO::minus(), State(), and table.
Referenced by FSMSADF::MPExplore::Exploration::exploreDelayForSchedule().
MPTime FSMSADF::MPExplore::State::norm | ( | ) |
norm() The function returns the norm of the token production times.
References MaxPlus::MP_MAX(), and table.
Referenced by FSMSADF::MPExplore::Exploration::exploreDelayForSchedule(), and normalize().
MPDelay FSMSADF::MPExplore::State::normalize | ( | ) |
normalize() The function normalizes the production time fo the tokens in all FIFOs.
References norm(), table, and timestamp.
Referenced by FSMSADF::MPExplore::Exploration::exploreDelayForSchedule(), and FSMSADF::MPExplore::Exploration::exploreEigen().
References FSMSADF::MPExplore::TokenFIFO::append(), c, FSMSADF::Port::getChannel(), FSMSADF::GraphComponent::getId(), and FSMSADF::Port::getRateOfScenario().
Referenced by FSMSADF::MPExplore::SGraph::fire().
void FSMSADF::MPExplore::State::smooth | ( | State * | y | ) |
smooth() The function performs a smooth operation on all FIFOs.
References table.
Referenced by FSMSADF::MPExplore::Exploration::exploreEigen().
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.
References c, FSMSADF::ScenarioGraph::getChannels(), FSMSADF::GraphComponent::getId(), FSMSADF::Channel::getInitialTokens(), FSMSADF::MPExplore::SGraph::scenarioGraph, State(), FSMSADF::MPExplore::SGraph::synchStorage, table, and TokenFIFO.
zeroState() Initialize this state as an initial state (i.e. channels contains only initial tokens and no time has passed so far).
References c, FSMSADF::ScenarioGraph::getChannels(), FSMSADF::GraphComponent::getId(), FSMSADF::Channel::getInitialTokens(), FSMSADF::MPExplore::SGraph::scenarioGraph, State(), FSMSADF::MPExplore::SGraph::synchStorage, table, timestamp, and TokenFIFO.
Referenced by FSMSADF::MPExplore::Exploration::exploreEigen().
Member Data Documentation
vector<TokenFIFO*> FSMSADF::MPExplore::State::table [private] |
Referenced by actorEnabled(), add(), asVector(), compare(), copy(), equals(), firstToken(), fromVector(), hashValue(), init(), minus(), norm(), normalize(), smooth(), zeroScheduleState(), zeroState(), and ~State().
MPTime FSMSADF::MPExplore::State::timestamp [private] |
Referenced by copy(), fromVector(), normalize(), and zeroState().
The documentation for this class was generated from the following files: