public void setProperty(string name, WorldStateValue stateValue) { if (!properties.ContainsKey(name)) { properties.Add(name, stateValue); } else { properties[name] = stateValue; } }
public void SetProperty(string name, WorldStateValue stateValue) //add a property to the worldstate { if (!properties.ContainsKey(name)) //if not contains the property, add it { properties.Add(name, stateValue); } else //if it contains it change its value { properties[name] = stateValue; } }
public WorldState GetGoal(int slump) //get a new goal from the list of available actions { string key = ""; WorldStateValue val = new WorldStateValue(true); Action action = actionsList[slump]; foreach (KeyValuePair <string, WorldStateValue> pair in action.postConditions.GetProperties()) { key = pair.Key; val = pair.Value; break; } return(new WorldState(key, val)); }
public WorldState GetGoal(int slump) { string key = ""; WorldStateValue val = new WorldStateValue(true); Action action = actionsList[slump];//.GetActionName(); foreach (KeyValuePair <string, WorldStateValue> pair in action.postConditions.getProperties()) { key = pair.Key; val = pair.Value; break; } //int slump = 3; /*string toBuild; * * string action = actionsList[slump].GetActionName(); * * for (int i = 1; i < action.Length; i++) * { * if (char.IsUpper(action[i])) * { * toBuild = action.Substring(i, action.Length-6); * break; * } * } * * * if(action.Substring(0, 1) == "B") * { * toBuild = action.Substring(5, action.Length-6); * char.ToLower(toBuild[0]); * //toBuild = char.ToLower(toBuild[0]) + toBuild.Substring(1); * * Debug.Log ("------------------------------>GetGoal()" + toBuild); * return new WorldState(toBuild + "IsBuilt", new WorldStateValue(true)); * }*/ //Debug.Log ("------------------------------>GetGoal() = " + key); return(new WorldState(key, val)); }
public WorldState(string name, WorldStateValue stateValue) { properties = new Dictionary <string, WorldStateValue>(); properties.Add(name, stateValue); }
public WorldState(string name, WorldStateValue stateValue) //create a worldstate with one property { properties = new Dictionary <string, WorldStateValue>(); properties.Add(name, stateValue); }
//create a worldstate with one property public WorldState(string name, WorldStateValue stateValue) { properties = new Dictionary<string, WorldStateValue>(); properties.Add(name, stateValue); }
//add a property to the worldstate public void SetProperty(string name, WorldStateValue stateValue) { if(!properties.ContainsKey(name)){ //if not contains the property, add it properties.Add(name, stateValue); } else { //if it contains it change its value properties[name] = stateValue; } }
//get a new goal from the list of available actions public WorldState GetGoal(int slump) { string key = ""; WorldStateValue val = new WorldStateValue(true); Action action = actionsList[slump]; foreach(KeyValuePair<string,WorldStateValue> pair in action.postConditions.GetProperties()) { key = pair.Key; val = pair.Value; break; } return new WorldState(key, val); }
public WorldState GetGoal(int slump) { string key = ""; WorldStateValue val = new WorldStateValue(true); Action action = actionsList[slump];//.GetActionName(); foreach(KeyValuePair<string,WorldStateValue> pair in action.postConditions.getProperties()) { key = pair.Key; val = pair.Value; break; } //int slump = 3; /*string toBuild; string action = actionsList[slump].GetActionName(); for (int i = 1; i < action.Length; i++) { if (char.IsUpper(action[i])) { toBuild = action.Substring(i, action.Length-6); break; } } if(action.Substring(0, 1) == "B") { toBuild = action.Substring(5, action.Length-6); char.ToLower(toBuild[0]); //toBuild = char.ToLower(toBuild[0]) + toBuild.Substring(1); Debug.Log ("------------------------------>GetGoal()" + toBuild); return new WorldState(toBuild + "IsBuilt", new WorldStateValue(true)); }*/ //Debug.Log ("------------------------------>GetGoal() = " + key); return new WorldState(key, val); }
public WorldStateProperty(string name, WorldStateValue stateValue) { propertyName = name; propertyValue = stateValue; }
public void setProperty(string name, WorldStateValue stateValue) { if(!properties.ContainsKey(name)){ properties.Add(name, stateValue); } else { properties[name] = stateValue; } }