private void ButtonAddAction_Click(object sender, RoutedEventArgs e) { if (ActionAdd.SelectedWARecordType == null) { ActionAdd.LabelValidation.Content = "It is necessary to choose an action."; } else if (ActionList.AddAction(ActionAdd.Time, ActionAdd.SelectedWARecordType.Id, ActionAdd.SelectedWARecordType.Duration)) { _scenarioDescription.addACS(ActionAdd.SelectedWARecordType, ActionAdd.Time); ActionAdd.CleanValues(); } else { ActionAdd.LabelValidation.Content = "Two actions at the some time are forbidden."; } }
public void SetUp() { // BASIC WORLD DESCRIPTION _worldDescription = new WorldDescription(); _worldDescription.Descriptions.Add(new Tuple <WorldDescriptionRecordType, WorldDescriptionRecord>(WorldDescriptionRecordType.Initially, new InitialRecord("a || b || c || d"))); _worldDescription.Descriptions.Add(new Tuple <WorldDescriptionRecordType, WorldDescriptionRecord>(WorldDescriptionRecordType.ActionCausesIf, new ActionCausesIfRecord(this._actionA2, "a && !b", "c"))); _worldDescription.Descriptions.Add(new Tuple <WorldDescriptionRecordType, WorldDescriptionRecord>(WorldDescriptionRecordType.ActionCausesIf, new ActionCausesIfRecord(this._actionB3, "a || b", "d"))); // BASIC SCENARIO _scenarioDescription = new ScenarioDescription("basic"); _scenarioDescription.addObservation(new SimpleLogicExpression("a && b && c && d"), 0); _scenarioDescription.addACS(this._actionA2, 1); _scenarioDescription.addObservation(new SimpleLogicExpression("a && !b && c && d"), 4); _reasoning = new Reasoning(); foreach (var description in _worldDescription.Descriptions.Select(t => t.Item2)) { _reasoning.AddWorldDescriptionRecord(description); } }