Page MenuHomePhorge

StateHandler.h
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

StateHandler.h

#ifndef STATEHANDLER_HEADERFILE
#define STATEHANDLER_HEADERFILE
//#include "Module.h"
#include "Unit.h"
#include "SlaveAgentSlotOfAgent.h"
#include "State.h"
#include "StateVariable.h"
#include <vector>
//XXX - only for now
#include "CSV_Writer.h"
using namespace std;
class StateHandler : public Unit {
//class StateHandler : public Module {
private:
//XXX - Maybe Object "StateVariable" between StateHandler and Slot?!
vector<SlaveAgentSlotOfAgent*> vInputVariables;
vector<SlaveAgentSlotOfAgent*> vOutputVariables;
vector<State*> vStates;
State* activeState;
unsigned int minNumToBeValidState;
bool flagVariablesWereStable;
unsigned int slidingWindowBufferSize;
unsigned int minNumOfRelatedValuesToBeStable;
float thresholdToBeStable;
float thresholdToBeRelated;
unsigned int discreteAveragePartitionSize;
unsigned int compareDistanceDiscreteAveragePartition;
float thresholdNotDrift;
void initStateHandler();
bool addVariable(vector<SlaveAgentSlotOfAgent*>* vVariables, SlaveAgentSlotOfAgent* slot);
bool StateHandler::variableIsStable(SlaveAgentSlotOfAgent* variable);
bool variablesAreStable(vector<SlaveAgentSlotOfAgent*>* vVariables);
State* makeNewState();
bool addActiveStateToStateVector();
//bool addStateAndMakeItActive();
bool makeNewActiveState();
State* findRelatedState();
bool findRelatedStateAndMakeItActive();
void eraseStatesWithLessInjections();
//XXX - only for now:
CSV_Writer* csv_writer;
public:
StateHandler();
StateHandler(char* name);
bool setDiscreteAveragePartitionSize(unsigned int discreteAverage);
unsigned int getDiscreteAveragePartitionSize();
bool addInputVariable(SlaveAgentSlotOfAgent* slot);
bool addOutputVariable(SlaveAgentSlotOfAgent* slot);
bool setSlidingWindowBufferSize(unsigned int slidingWindowBufferSize);
bool setMinNumOfRelatedValuesToBeStable(unsigned int minNumOfRelatedValuesToBeStable);
bool setThresholdToBeStable(float thresholdToBeStable);
bool setThresholdToBeRelated(float thresholdToBeRelated);
void trigger(unsigned int cycle);
//XXX - only for now
void closeCsvFile();
/*
private:
vector<SlaveAgentSlotOfAgent*> vSlots;
unsigned int minNumOfChangedForValidStateChange;
unsigned int minimumInjectionsForBeingState;
void initStateHandler();
public:
StateHandler();
StateHandler(char* name);
bool setMinimumInjectionsForBeingState(unsigned int minimumInjectionsForBeingState);
unsigned int getMinimumInjectionsForBeingState();
//TODO: function for deleting slot and function with the whole vector as parameter
bool add_slot(SlaveAgentSlotOfAgent* slot);
void set_minNumOfChangedForValidStateChange(unsigned int minNumOfChangedForValidStateChange);
unsigned int get_minNumOfChangedForValidStateChange();
bool trigger();
*/
};
#endif

File Metadata

Mime Type
text/x-c++
Expires
Sun, Mar 1, 5:51 PM (7 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
288028
Default Alt Text
StateHandler.h (2 KB)

Event Timeline