Loading...
Searching...
No Matches
PixelCrushers.QuestMachine.WorldModel Class Reference

A world model is a collection of facts that an observer believes to be true, representing the observer's knowledge of the current world state. More...

Public Member Functions

 WorldModel (Fact observer)
 
 WorldModel (WorldModel source)
 
Fact FindFact (DomainType domainType, EntityType entityType)
 
bool ContainsFact (DomainType domainType, EntityType entityType, int min, int max)
 
void AddEntityType (DomainType domainType, EntityType entityType, int count=1)
 
void RemoveEntityType (DomainType domainType, EntityType entityType, int count=1)
 
void AddFact (Fact fact)
 
void RemoveFact (Fact fact)
 
float ComputeUrgency (UrgentFactSelectionMode factSelectionMode, out Fact[] mostUrgentFacts, string[] ignoreList=null, bool debug=false)
 Computes the world model's urgency.
 
float ComputeUrgency (out Fact mostUrgentFact, string[] ignoreList=null)
 
float GetFactUrgency (Fact fact)
 
void ApplyAction (Fact fact, Action action)
 
bool AreRequirementsMet (ActionRequirement[] requirements)
 
bool AreRequirementsMet (ActionRequirement[] requirements, Fact fact)
 

Properties

Fact observer [get, set]
 
Fact observed [get, set]
 
List< Factfacts [get, set]
 

Detailed Description

A world model is a collection of facts that an observer believes to be true, representing the observer's knowledge of the current world state.

Constructor & Destructor Documentation

◆ WorldModel() [1/2]

PixelCrushers.QuestMachine.WorldModel.WorldModel ( Fact  observer)
inline

◆ WorldModel() [2/2]

PixelCrushers.QuestMachine.WorldModel.WorldModel ( WorldModel  source)
inline

Member Function Documentation

◆ AddEntityType()

void PixelCrushers.QuestMachine.WorldModel.AddEntityType ( DomainType  domainType,
EntityType  entityType,
int  count = 1 
)
inline

◆ AddFact()

void PixelCrushers.QuestMachine.WorldModel.AddFact ( Fact  fact)
inline

◆ ApplyAction()

void PixelCrushers.QuestMachine.WorldModel.ApplyAction ( Fact  fact,
Action  action 
)
inline

◆ AreRequirementsMet() [1/2]

bool PixelCrushers.QuestMachine.WorldModel.AreRequirementsMet ( ActionRequirement[]  requirements)
inline

◆ AreRequirementsMet() [2/2]

bool PixelCrushers.QuestMachine.WorldModel.AreRequirementsMet ( ActionRequirement[]  requirements,
Fact  fact 
)
inline

◆ ComputeUrgency() [1/2]

float PixelCrushers.QuestMachine.WorldModel.ComputeUrgency ( out Fact  mostUrgentFact,
string[]  ignoreList = null 
)
inline

◆ ComputeUrgency() [2/2]

float PixelCrushers.QuestMachine.WorldModel.ComputeUrgency ( UrgentFactSelectionMode  factSelectionMode,
out Fact[]  mostUrgentFacts,
string[]  ignoreList = null,
bool  debug = false 
)
inline

Computes the world model's urgency.

Parameters
factSelectionModeMethod by which to compute fact urgency.
mostUrgentFactsGets set to a list of most-urgent facts in the world model.
ignoreListIgnore entities named in this list when computing urgency.
numTopFactsToChooseMaximum number of most-urgent facts to return in mostUrgentFacts.
debugIf true, logs details of this function's operation.
Returns
The cumulative urgency of all facts in the world model.

◆ ContainsFact()

bool PixelCrushers.QuestMachine.WorldModel.ContainsFact ( DomainType  domainType,
EntityType  entityType,
int  min,
int  max 
)
inline

◆ FindFact()

Fact PixelCrushers.QuestMachine.WorldModel.FindFact ( DomainType  domainType,
EntityType  entityType 
)
inline

◆ GetFactUrgency()

float PixelCrushers.QuestMachine.WorldModel.GetFactUrgency ( Fact  fact)
inline

◆ RemoveEntityType()

void PixelCrushers.QuestMachine.WorldModel.RemoveEntityType ( DomainType  domainType,
EntityType  entityType,
int  count = 1 
)
inline

◆ RemoveFact()

void PixelCrushers.QuestMachine.WorldModel.RemoveFact ( Fact  fact)
inline

Property Documentation

◆ facts

List<Fact> PixelCrushers.QuestMachine.WorldModel.facts
getset

◆ observed

Fact PixelCrushers.QuestMachine.WorldModel.observed
getset

◆ observer

Fact PixelCrushers.QuestMachine.WorldModel.observer
getset

The documentation for this class was generated from the following file: