Ejemplo n.º 1
0
        public HM1BOutputContext(
            ICalculationsAbstractFactory calculationsAbstractFactory,
            IDependenciesAbstractFactory dependenciesAbstractFactory,
            IResultElementsAbstractFactory resultElementsAbstractFactory,
            IResultsAbstractFactory resultsAbstractFactory,
            IHM1BModel HM1BModel,
            Solution solution)
        {
            // BestBound
            this.BestBound = resultsAbstractFactory.CreateBestBoundFactory().Create(
                (decimal)solution.BestBound)
                             .GetValueForOutputContext(
                dependenciesAbstractFactory.CreateNullableValueFactory());

            // Gap
            this.Gap = resultsAbstractFactory.CreateGapFactory().Create(
                (decimal)solution.Gap)
                       .GetValueForOutputContext(
                dependenciesAbstractFactory.CreateNullableValueFactory());

            // NumberOfExploredNodes
            this.NumberOfExploredNodes = resultsAbstractFactory.CreateNumberOfExploredNodesFactory().Create(
                solution.NumberOfExploredNodes)
                                         .GetValueForOutputContext();

            // ObjectiveValue
            this.ObjectiveValue = resultsAbstractFactory.CreateObjectiveValueFactory().Create(
                (decimal)solution.ObjectiveValues.SingleOrDefault().Value)
                                  .GetValueForOutputContext(
                dependenciesAbstractFactory.CreateNullableValueFactory());

            // OverallWallTime
            this.OverallWallTime = resultsAbstractFactory.CreateOverallWallTimeFactory().Create(
                solution.OverallWallTime)
                                   .GetValueForOutputContext();

            // B(s)
            HM.HM1B.A.E.O.Interfaces.Results.SurgeonNumberAssignedTimeBlocks.IB Bs = HM1BModel.B.GetElementsAt(
                resultElementsAbstractFactory.CreateBsResultElementFactory(),
                resultsAbstractFactory.CreateBsFactory(),
                HM1BModel.s);

            this.SurgeonNumberAssignedTimeBlocks = Bs.GetValueForOutputContext(
                dependenciesAbstractFactory.CreateNullableValueFactory());

            // BBar(j)
            this.SurgicalSpecialtyNumberAssignedTimeBlocks = calculationsAbstractFactory.CreateBCalculationFactory().Create().Calculate(
                calculationsAbstractFactory.CreateBResultElementCalculationFactory(),
                resultElementsAbstractFactory.CreateBBarResultElementFactory(),
                resultsAbstractFactory.CreateBBarFactory(),
                HM1BModel.Δ,
                Bs)
                                                             .GetValueForOutputContext(
                dependenciesAbstractFactory.CreateNullableValueFactory());
        }
Ejemplo n.º 2
0
 public HM.HM1B.A.E.O.Interfaces.Results.SurgicalSpecialtyNumberAssignedTimeBlocks.IB Calculate(
     IBResultElementCalculationFactory BResultElementCalculationFactory,
     IBResultElementFactory BResultElementFactory,
     IBFactory BFactory,
     IΔ Δ,
     HM.HM1B.A.E.O.Interfaces.Results.SurgeonNumberAssignedTimeBlocks.IB B)
 {
     return(BFactory.Create(
                Δ.Value
                .Select(
                    i => BResultElementCalculationFactory.Create().Calculate(
                        BResultElementFactory,
                        i,
                        B))
                .ToImmutableList()));
 }