Types in separate file. Other stuff...
This commit is contained in:
@@ -40,6 +40,7 @@ class CtxAut
|
|||||||
void showTransitions(void);
|
void showTransitions(void);
|
||||||
void pushContextEntity(Entity entity_id);
|
void pushContextEntity(Entity entity_id);
|
||||||
void setOptions(Options *opts) { this->opts = opts; }
|
void setOptions(Options *opts) { this->opts = opts; }
|
||||||
|
size_t statesCount(void) { return states_ids.size(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RctSys *parent_rctsys;
|
RctSys *parent_rctsys;
|
||||||
|
|||||||
8
rs.cc
8
rs.cc
@@ -172,14 +172,12 @@ void RctSys::showInitialStates(void)
|
|||||||
|
|
||||||
void RctSys::printSystem(void)
|
void RctSys::printSystem(void)
|
||||||
{
|
{
|
||||||
showInitialStates();
|
if (!usingContextAutomaton())
|
||||||
|
showInitialStates();
|
||||||
showActionEntities();
|
showActionEntities();
|
||||||
showReactions();
|
showReactions();
|
||||||
|
|
||||||
if (ctx_aut != nullptr)
|
if (ctx_aut != nullptr) ctx_aut->printAutomaton();
|
||||||
{
|
|
||||||
ctx_aut->printAutomaton();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RctSys::ctxAutEnable(void)
|
void RctSys::ctxAutEnable(void)
|
||||||
|
|||||||
1
rs.hh
1
rs.hh
@@ -76,6 +76,7 @@ class RctSys
|
|||||||
void ctxAutPushNamedContextEntity(std::string entity_name);
|
void ctxAutPushNamedContextEntity(std::string entity_name);
|
||||||
|
|
||||||
bool initStatesDefined(void) { return initStates.size() != 0; }
|
bool initStatesDefined(void) { return initStates.size() != 0; }
|
||||||
|
bool usingContextAutomaton(void) { return ctx_aut != nullptr; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Reactions reactions;
|
Reactions reactions;
|
||||||
|
|||||||
2
symrs.cc
2
symrs.cc
@@ -320,7 +320,7 @@ void SymRS::encodeInitStates(void)
|
|||||||
if (opts->part_tr_rel)
|
if (opts->part_tr_rel)
|
||||||
assert(partTrans != nullptr);
|
assert(partTrans != nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
initStates = new BDD(BDD_FALSE);
|
initStates = new BDD(BDD_FALSE);
|
||||||
|
|
||||||
for (auto state = rs->initStates.begin();
|
for (auto state = rs->initStates.begin();
|
||||||
|
|||||||
41
types.hh
Normal file
41
types.hh
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2018
|
||||||
|
Artur Meski <meski@ipipan.waw.pl>
|
||||||
|
|
||||||
|
Reuse of the code or its part for any purpose
|
||||||
|
without the author's permission is strictly prohibited.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RS_TYPES_HH
|
||||||
|
#define RS_TYPES_HH
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
typedef unsigned int Entity;
|
||||||
|
typedef std::set<Entity> Entities;
|
||||||
|
struct Reaction {
|
||||||
|
Entities rctt;
|
||||||
|
Entities inhib;
|
||||||
|
Entities prod;
|
||||||
|
};
|
||||||
|
typedef std::vector<Reaction> Reactions;
|
||||||
|
typedef std::vector<std::string> EntitiesByIds;
|
||||||
|
typedef std::map<std::string, Entity> EntitiesByName;
|
||||||
|
typedef std::set<Entities> EntitiesSets;
|
||||||
|
|
||||||
|
typedef unsigned int State;
|
||||||
|
typedef std::vector<std::string> StatesById;
|
||||||
|
typedef std::map<std::string, State> StatesByName;
|
||||||
|
|
||||||
|
struct Transition {
|
||||||
|
State src_state;
|
||||||
|
Entities ctx;
|
||||||
|
State dst_state;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::vector<Transition> Transitions;
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user