示例#1
0
        public ObjectiveFunction111(
            IObjectiveFactory objectiveFactory,
            IsΛ sΛ,
            IΡ Ρ,
            Iω ω,
            Ie1Minus e1Minus,
            Ie1Plus e1Plus)
        {
            Expression expression = Expression.Sum(
                sΛ.Value
                .Select(
                    x => (double)Ρ.GetElementAtAsdecimal(
                        x.ΛIndexElement)
                    *
                    (double)ω.GetElementAtAsdecimal(
                        x.sIndexElement)
                    *
                    (e1Minus.Value[x.sIndexElement, x.ΛIndexElement]
                     +
                     e1Plus.Value[x.sIndexElement, x.ΛIndexElement])
                    *
                    (e1Minus.Value[x.sIndexElement, x.ΛIndexElement]
                     +
                     e1Plus.Value[x.sIndexElement, x.ΛIndexElement])));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
        public ITPObjectiveFunction Create(
            IObjectiveFactory objectiveFactory,
            Id d,
            Iw w,
            Iα α,
            Iβ β,
            Iγ γ,
            IδMinus δMinus,
            Interfaces.Variables.TP.WardSpareBeds.IδPlus δPlus_w,
            Interfaces.Variables.TP.WardBedOccupancyVariances.IVariance Variance_w)
        {
            ITPObjectiveFunction objectiveFunction = null;

            try
            {
                objectiveFunction = new TPObjectiveFunction(
                    objectiveFactory,
                    d,
                    w,
                    α,
                    β,
                    γ,
                    δMinus,
                    δPlus_w,
                    Variance_w);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }
示例#3
0
        public IObjectiveFunction110 Create(
            IObjectiveFactory objectiveFactory,
            IsΛ sΛ,
            IΡ Ρ,
            Iω ω,
            Ie1Minus e1Minus,
            Ie1Plus e1Plus)
        {
            IObjectiveFunction110 objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction110(
                    objectiveFactory,
                    sΛ,
                    Ρ,
                    ω,
                    e1Minus,
                    e1Plus);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }
        public IObjectiveFunction100 Create(
            IObjectiveFactory objectiveFactory,
            Imr mr,
            IC C,
            Iv v)
        {
            IObjectiveFunction100 objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction100(
                    objectiveFactory,
                    mr,
                    C,
                    v);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }
        public ISPObjectiveFunction Create(
            IObjectiveFactory objectiveFactory,
            Ipa pa,
            Ir r,
            ISPx x)
        {
            ISPObjectiveFunction objectiveFunction = null;

            try
            {
                objectiveFunction = new SPObjectiveFunction(
                    objectiveFactory,
                    pa,
                    r,
                    x);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }
示例#6
0
        public IObjectiveFunction Create(
            IObjectiveFactory objectiveFactory,
            It t,
            IΛ Λ,
            IΡ Ρ,
            IIHat IHat)
        {
            IObjectiveFunction objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction(
                    objectiveFactory,
                    t,
                    Λ,
                    Ρ,
                    IHat);
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(objectiveFunction);
        }
示例#7
0
 public AddObjectiveCommandHandler(
     IObjectiveFactory objectiveFactory,
     IObjectiveRepository objectiveRepository,
     IUnitOfWork unitOfWork)
 {
     _objectiveFactory    = objectiveFactory ?? throw new ArgumentNullException(nameof(objectiveFactory));
     _objectiveRepository = objectiveRepository ?? throw new ArgumentNullException(nameof(objectiveRepository));
     _unitOfWork          = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
 }
示例#8
0
        public IObjectiveFactory CreateObjectiveFactory()
        {
            IObjectiveFactory factory = null;

            try
            {
                factory = new ObjectiveFactory();
            }
            catch (Exception exception)
            {
                this.Log.Error("Exception message: " + exception.Message + " and stacktrace " + exception.StackTrace);
            }

            return(factory);
        }
        public ObjectiveFunction001(
            IObjectiveFactory objectiveFactory,
            Isr sr,
            Iy y)
        {
            Expression expression = Expression.Sum(
                sr.Value
                .Select(
                    x => y.Value[x.sIndexElement, x.rIndexElement]));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
        public ObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            Isd sd,
            Iu u)
        {
            Expression expression = Expression.Sum(
                sd.Value
                .Select(
                    x => u.Value[x.sIndexElement, x.dIndexElement]));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
        public ObjectiveFunction010(
            IObjectiveFactory objectiveFactory,
            Ijr jr,
            Iw w)
        {
            Expression expression = Expression.Sum(
                jr.Value
                .Select(
                    x => w.Value[x.jIndexElement, x.rIndexElement]));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
示例#12
0
        public IObjectiveFactory CreateObjectiveFactory()
        {
            IObjectiveFactory factory = null;

            try
            {
                factory = new ObjectiveFactory();
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(factory);
        }
示例#13
0
        public ObjectiveFunction100(
            IObjectiveFactory objectiveFactory,
            Imr mr,
            IC C,
            Iv v)
        {
            Expression expression = Expression.Sum(
                mr.Value
                .Select(
                    x => (double)C.GetElementAtAsdecimal(
                        x.mIndexElement)
                    *
                    v.Value[x.mIndexElement, x.rIndexElement]));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
        public SPObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            Ipa pa,
            Ir r,
            ISPx x)
        {
            Expression expression = Expression.Sum(
                pa.Value
                .Select(
                    i =>
                    (double)r.GetElementAtAsdecimal(
                        i.pIndexElement)
                    *
                    x.Value[i.pIndexElement, i.aIndexElement]));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Maximize);

            this.Value = objective;
        }
        public TPObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            Id d,
            Iw w,
            Iα α,
            Iβ β,
            Iγ γ,
            IδMinus δMinus,
            Interfaces.Variables.TP.WardSpareBeds.IδPlus δPlus_w,
            Interfaces.Variables.TP.WardBedOccupancyVariances.IVariance Variance_w)
        {
            Expression expression = Expression.Sum(
                w.Value
                .Select(
                    i =>
                    (double)α.GetElementAtAsdecimal(
                        i)
                    *
                    Expression.Sum(
                        d.Value
                        .Select(
                            j =>
                            δMinus.Value[i, j]))
                    +
                    (double)β.GetElementAtAsdecimal(
                        i)
                    *
                    δPlus_w.Value[i]
                    +
                    (double)γ.GetElementAtAsdecimal(
                        i)
                    *
                    Variance_w.Value[i]));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
示例#16
0
        public IObjectiveFunction Create(
            IObjectiveFactory objectiveFactory,
            Isd sd,
            Iu u)
        {
            IObjectiveFunction objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction(
                    objectiveFactory,
                    sd,
                    u);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }
        public ObjectiveFunction(
            IObjectiveFactory objectiveFactory,
            It t,
            IΛ Λ,
            IΡ Ρ,
            IIHat IHat)
        {
            Expression expression = Expression.Sum(
                Λ.Value
                .Select(
                    x => (double)Ρ.GetElementAtAsdecimal(
                        x)
                    *
                    Expression.Maximum(
                        t.Value
                        .Select(y => (Expression)IHat.Value[y, x]))));

            Objective objective = objectiveFactory.Create(
                expression,
                ObjectiveSense.Minimize);

            this.Value = objective;
        }
示例#18
0
        public IObjectiveFunction001 Create(
            IObjectiveFactory objectiveFactory,
            Isr sr,
            Iy y)
        {
            IObjectiveFunction001 objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction001(
                    objectiveFactory,
                    sr,
                    y);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }
示例#19
0
        public IObjectiveFunction010 Create(
            IObjectiveFactory objectiveFactory,
            Ijr jr,
            Iw w)
        {
            IObjectiveFunction010 objectiveFunction = null;

            try
            {
                objectiveFunction = new ObjectiveFunction010(
                    objectiveFactory,
                    jr,
                    w);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(objectiveFunction);
        }