86 bool addGoal(
size_t id,
Goal * goal );
100 Goal * getGoalByID(
size_t id );
114 Goal * getGoalByIDConcurrent(
size_t id );
128 Goal * getIthGoal(
size_t i );
142 Goal * getIthGoalConcurrent(
size_t i );
149 size_t size()
const {
return _goalIDs.size(); }
156 size_t sizeConcurrent()
const;
163 Goal * getRandomGoal();
170 Goal * getRandomWeightedGoal();
189 void setGoalFull(
const Goal * goal )
const;
196 void setGoalAvailable(
const Goal * goal )
const;
229 #endif //__GOALSET_H__
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
std::vector< size_t > _goalIDs
A vector of valid identifiers in the goal set.
Definition: GoalSet.h:206
void lockRead()
Locks the goal set for a read-only operations.
Definition: GoalSet.h:175
A set of goals. Maps integer identifiers to instances of goals.
Definition: GoalSet.h:63
The base, abstract class defining goals.
Definition: Goal.h:110
The definition of a readers-writer lock.
Definition: ReadersWriterLock.h:62
size_t size() const
Reports the number of goals in the set. Not thread safe.
Definition: GoalSet.h:149
ReadersWriterLock _lock
The lock to maintain readers-writer access to the structure which control available goals...
Definition: GoalSet.h:222
float _totalWeight
The sum of all goal weights.
Definition: GoalSet.h:211
The definition of a readers-writer lock.
UniformFloatGenerator _randVal
The random die to select random and weighted goals.
Definition: GoalSet.h:216
The namespace contains the Behavior Finite State Machine (BFSM) definition.
Collection of convenient pre-compiler information for fsm definitions.
std::map< size_t, Goal * > _goals
The underlying mapping from user-specified goal identifier to goal.
Definition: GoalSet.h:201
void releaseRead()
Unlocks the goal set from read-only operations.
Definition: GoalSet.h:180