17#ifndef YASMIN__CONCURRENCE_HPP_
18#define YASMIN__CONCURRENCE_HPP_
std::shared_ptr< Blackboard > SharedPtr
Shared pointer type for Blackboard.
Definition blackboard.hpp:85
const StateMap states
The states to run concurrently (name -> state)
Definition concurrence.hpp:49
std::string execute(Blackboard::SharedPtr blackboard) override
Executes the state's specific logic.
Definition concurrence.cpp:85
Outcomes possible_outcomes
The set of possible outcomes.
Definition concurrence.hpp:62
StateOutcomeMap intermediate_outcome_map
Stores the intermediate outcomes of the concurrent states.
Definition concurrence.hpp:59
std::string to_string() const override
Converts the state to a string representation.
Definition concurrence.cpp:186
const std::string & get_default_outcome() const noexcept
Returns the default outcome for this concurrence state.
Definition concurrence.cpp:168
void cancel_state() override
Cancels the current state execution.
Definition concurrence.cpp:153
const StateMap & get_states() const noexcept
Returns the map of states managed by this concurrence state.
Definition concurrence.cpp:160
std::mutex intermediate_outcome_mutex
Mutex for intermediate outcome map.
Definition concurrence.hpp:66
const std::string default_outcome
Default outcome.
Definition concurrence.hpp:52
OutcomeMap outcome_map
Definition concurrence.hpp:56
static Outcomes generate_possible_outcomes(const OutcomeMap &outcome_map, const std::string &default_outcome)
Helper function to generate a set of possible outcomes from an outcome map.
Definition concurrence.cpp:173
const OutcomeMap & get_outcome_map() const noexcept
Returns the outcome map for this concurrence state.
Definition concurrence.cpp:164
Concurrence(const StateMap &states, const std::string &default_outcome, const OutcomeMap &outcome_map)
Shared pointer type for Concurrence.
Definition concurrence.cpp:30
State(const Outcomes &outcomes)
Shared pointer type for State.
Definition state.cpp:32
Definition blackboard.hpp:31
std::unordered_map< std::string, StateOutcomeMap > OutcomeMap
Map of outcomes to state outcome maps.
Definition types.hpp:81
std::unordered_map< std::string, std::shared_ptr< State > > StateMap
Map of state names to state pointers.
Definition types.hpp:104
StringSet Outcomes
Set of possible outcomes for states.
Definition types.hpp:77
StringMap StateOutcomeMap
Map of state names to their outcomes.
Definition types.hpp:79
#define YASMIN_PTR_ALIASES(ClassName)
Macro to define all pointer aliases for a class.
Definition types.hpp:52