Ejemplo n.º 1
0
        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));
        }