public Unit Execute(ProblemOccurrence po) { var alternatives = po.Alternatives(Repo.GetElement).Select(oo => { oo.State = SolutionSpace.OptionState.Neglected; Repo.PropagateChanges(oo); return(oo); }); po.State = po.DeduceState(alternatives); Repo.PropagateChanges(po); return(Unit.Instance); }
public R Execute(OptionOccurrence oo) { oo.State = SolutionSpace.OptionState.Chosen; Repo.PropagateChanges(oo); (from po in oo.AssociatedProblemOccurrences(Repo.GetElement) from otherOo in po.Alternatives(Repo.GetElement) where !oo.Equals(otherOo) select otherOo).ForEach(otherOo => { if (otherOo.State != SolutionSpace.OptionState.Chosen && otherOo.State != SolutionSpace.OptionState.Neglected) { otherOo.State = SolutionSpace.OptionState.Neglected; Repo.PropagateChanges(otherOo); } }); return(UpdateProblemOccurrenceState.Execute(oo)); }