Exemplo n.º 1
0
        public IConstraints13LConstraintElement Create(
            IdIndexElement dIndexElement,
            IwIndexElement wIndexElement,
            ITPy y,
            IδMinus δMinus,
            Iμ μ)
        {
            IConstraints13LConstraintElement constraintElement = null;

            try
            {
                constraintElement = new Constraints13LConstraintElement(
                    dIndexElement,
                    wIndexElement,
                    y,
                    δMinus,
                    μ);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(constraintElement);
        }
        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);
        }
Exemplo n.º 3
0
        public Constraints13LConstraintElement(
            IdIndexElement dIndexElement,
            IwIndexElement wIndexElement,
            ITPy y,
            IδMinus δMinus,
            Iμ μ)
        {
            Expression LHS =
                -δMinus.Value[wIndexElement, dIndexElement];

            Expression RHS =
                y.Value[wIndexElement]
                -
                μ.Value[wIndexElement, dIndexElement];

            this.Value = LHS <= RHS;
        }
Exemplo n.º 4
0
        public IδMinus Create(
            ImmutableList <IδMinusResultElement> value)
        {
            IδMinus result = null;

            try
            {
                result = new δMinus(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(result);
        }
Exemplo n.º 5
0
        public IδMinus Create(
            VariableCollection <IwIndexElement, IdIndexElement> value)
        {
            IδMinus variable = null;

            try
            {
                variable = new δMinus(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(variable);
        }
        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;
        }