// Import from XML with DataContract public void ImportData(FileStream inStream) { // Deserialize fs into disc Discovered disc = null; var dcs = new DataContractSerializer(typeof(Discovered)); using (var reader = XmlDictionaryReader.CreateTextReader(inStream, new XmlDictionaryReaderQuotas())) disc = (Discovered)dcs.ReadObject(reader, true); // Copy relevant members stateValues = disc.stateValues; }
public override string ToString() => Discovered.ToString();
// Use GoalTest to invoke appropriate behaviors public IState Act(List <IState> successorStates) { // Return the next best option return(Discovered.ChooseSuccessor(successorStates)); }
public void Draw(object sender, EventArgs e) { Discovered.Reset(); Draws += 1; }
public void Defeat(object sender, EventArgs e) { Discovered.Penalize(); Defeats += 1; }
// Respond to victory, defeat, and draw events public void Victory(object sender, EventArgs e) { Discovered.Reward(); Victories += 1; }
// Create a default Agent with no GoalTest public Agent() { Discovered = new Discovered(); }