Class GoalStructure<TBeliefSet>
- Namespace
- Aplib.Core.Desire.GoalStructures
- Assembly
- Aplib.Core.dll
Describes a structure of goals that need to be fulfilled.
public abstract class GoalStructure<TBeliefSet> : IGoalStructure<TBeliefSet>, ICompletable, ILoggable, IDocumented where TBeliefSet : IBeliefSet
Type Parameters
TBeliefSet
- Inheritance
-
GoalStructure<TBeliefSet>
- Implements
-
IGoalStructure<TBeliefSet>
- Derived
- Inherited Members
- Extension Methods
Constructors
GoalStructure(IMetadata, IEnumerable<IGoalStructure<TBeliefSet>>)
Initializes a new instance of the GoalStructure<TBeliefSet> class.
protected GoalStructure(IMetadata metadata, IEnumerable<IGoalStructure<TBeliefSet>> children)
Parameters
metadata
IMetadataMetadata about this GoalStructure, used to quickly display the goal in several contexts.
children
IEnumerable<IGoalStructure<TBeliefSet>>The children of the goal structure.
GoalStructure(IEnumerable<IGoalStructure<TBeliefSet>>)
Initializes a new instance of the GoalStructure<TBeliefSet> class.
protected GoalStructure(IEnumerable<IGoalStructure<TBeliefSet>> children)
Parameters
children
IEnumerable<IGoalStructure<TBeliefSet>>The children of the goal structure.
Fields
_children
The children of the goal structure.
protected readonly IEnumerable<IGoalStructure<TBeliefSet>> _children
Field Value
- IEnumerable<IGoalStructure<TBeliefSet>>
_currentGoalStructure
The goal structure that is currently being fulfilled.
protected IGoalStructure<TBeliefSet>? _currentGoalStructure
Field Value
- IGoalStructure<TBeliefSet>
Properties
Metadata
Gets the metadata of the instance. This metadata may be useful for debugging or logging.
public IMetadata Metadata { get; }
Property Value
Status
Gets the completion status of the instance.
public CompletionStatus Status { get; protected set; }
Property Value
Methods
GetCurrentGoal(TBeliefSet)
Gets the current goal using the given IBeliefSet.
public abstract IGoal<TBeliefSet> GetCurrentGoal(TBeliefSet beliefSet)
Parameters
beliefSet
TBeliefSetThe belief set of the agent.
Returns
- IGoal<TBeliefSet>
The current goal to be fulfilled.
GetLogChildren()
Gets the children of the loggable object.
public abstract IEnumerable<ILoggable> GetLogChildren()
Returns
- IEnumerable<ILoggable>
The children of the loggable object.
Reset()
Resets the goal structure to its initial state.
public virtual void Reset()
UpdateStatus(TBeliefSet)
Updates the state of the goal structure.
public abstract void UpdateStatus(TBeliefSet beliefSet)
Parameters
beliefSet
TBeliefSetThe belief set of the agent.
Operators
implicit operator GoalStructure<TBeliefSet>(Goal<TBeliefSet>)
Implicitly lifts a goal into a goal structure.
public static implicit operator GoalStructure<TBeliefSet>(Goal<TBeliefSet> goal)
Parameters
goal
Goal<TBeliefSet>The goal which on its own can function as a goal structure. Meaning, the goal structure consists of just a single goal.
Returns
- GoalStructure<TBeliefSet>
The most logically matching goal structure, wrapping around
goal
.