本文整理汇总了C#中WorldState.getProperties方法的典型用法代码示例。如果您正苦于以下问题:C# WorldState.getProperties方法的具体用法?C# WorldState.getProperties怎么用?C# WorldState.getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldState
的用法示例。
在下文中一共展示了WorldState.getProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: contains
public bool contains(WorldState ws)
{
Dictionary<string, WorldStateValue> wsProperties = ws.getProperties();
foreach(KeyValuePair<string, WorldStateValue> pair in properties)
{
if(ws.getProperties().ContainsKey(pair.Key))
{
if(wsProperties[pair.Key].propertyValues["bool"].Equals(pair.Value.propertyValues["bool"]))
{
continue;
}
else
{
return false;
}
}
else
{
return false;
}
}
return true;
}
示例2: SetCurrentWorldstate
public void SetCurrentWorldstate(string clan, WorldState ws)
{
WorldState currentWorldState = (WorldState)GetFact(clan, "currentWorldState")[0].GetFactValue();
RemoveFact(clan, "currentWorldState", new WorkingMemoryValue(currentWorldState));
WorldState tempWorldState = new WorldState ();
foreach(KeyValuePair<string, WorldStateValue> newState in ws.getProperties())
{
foreach (KeyValuePair<string, WorldStateValue> oldState in currentWorldState.getProperties())
{
if(oldState.Key == newState.Key)
{
tempWorldState.setProperty(newState.Key, newState.Value);
} else{
tempWorldState.setProperty(oldState.Key, oldState.Value);
}
}
}
SetFact(clan, "currentWorldState", new WorkingMemoryValue(tempWorldState));
}
示例3: getSuitableActions
public List<Action> getSuitableActions(WorldState postCon)
{
//return the list with actions suitable for a certain goal
List<Action> actionList = new List<Action>();
bool okayToAddAction;
foreach (Action action in actionsList){
okayToAddAction = false;
foreach(KeyValuePair<string, WorldStateValue> pair in postCon.getProperties())
{
if(action.ContainsPostCondition(pair.Key, !(bool)pair.Value.propertyValues["bool"]))
{
okayToAddAction = false;
break;
}
else if(action.ContainsPostCondition(pair.Key, (bool)pair.Value.propertyValues["bool"]) /*&& action.getAgentTypes().Contains(currentAgent)*/){
okayToAddAction = true;
} else {
okayToAddAction = false;
break;
}
}
if(okayToAddAction == true){
actionList.Add(action);
}
}
return actionList;
}