diff --git a/include/rosa/agent/State.hpp b/include/rosa/agent/State.hpp index a3cd936..06bb085 100644 --- a/include/rosa/agent/State.hpp +++ b/include/rosa/agent/State.hpp @@ -1,64 +1,77 @@ //===-- rosa/agent/State.hpp ----------------------------*- C++ -*-===// // // The RoSA Framework // //===----------------------------------------------------------------------===// /// /// \file rosa/agent/State.hpp /// /// \author Maximilian Götzinger (maximilian.goetzinger@tuwien.ac.at) /// /// \date 2019 /// /// \brief Definition of *state* *functionality*. /// //===----------------------------------------------------------------------===// #ifndef ROSA_AGENT_STATE_HPP #define ROSA_AGENT_STATE_HPP #include "rosa/agent/Functionality.h" #include "rosa/agent/History.hpp" namespace rosa { namespace agent { /// \tparam D type of data template class State : public Functionality { private: DynamicHistory SampleHistory; //Make History dynamic DynamicHistory DAB; DynamicHistory DABHistory; //Implement LIFO public: + State(unsigned int sampleHistorySize, unsigned int DABSize, unsigned int DABHistorySize) noexcept : SampleHistory(sampleHistorySize), DAB(DABSize), DABHistory(DABHistorySize) {} ~State(void) = default; - + bool insertSample(D Sample) { bool workedForAll; workedForAll = SampleHistory.addEntry(Sample); - //check if full/empty - - workedForAll &= DAB.addEntry(Sample) - - - + if (workedForAll) { + + if (numberOfEntries >= DAB) { + + + + } + + + //check if full/empty + workedForAll &= DAB.addEntry(Sample); + + + + + + + } } }; } // End namespace agent } // End namespace rosa #endif // ROSA_AGENT_STATE_HPP \ No newline at end of file