// w and y are both variables public IConstraints5UConstraintElement Create( IjIndexElement jIndexElement, IrIndexElement rIndexElement, IsIndexElement sIndexElement, Interfaces.Parameters.SurgicalSpecialtyNumberAssignedTimeBlocks.IB BBar, Interfaces.Parameters.SurgeonNumberAssignedTimeBlocks.IB Bs, Iw w, Iy y) { IConstraints5UConstraintElement constraintElement = null; try { constraintElement = new Constraints5UConstraintElement( jIndexElement, rIndexElement, sIndexElement, BBar, Bs, w, y); } 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); }
public IEBSResultElement Calculate( IEBSResultElementFactory EBSResultElementFactory, IdIndexElement dIndexElement, Iw w, IBEDS BEDS, Iμ μ, IVariance Variance) { int BEDS_d = BEDS.Value.Value.Value; double ExpectedValue_d = w.Value .Select(y => (double)μ.GetElementAtAsdecimal( y, dIndexElement)) .Sum(); double Variance_d = w.Value .Select(y => (double)Variance.GetElementAtAsdecimal( y, dIndexElement)) .Sum(); double lowerBound = BEDS_d + 0.5; double upperBound = double.PositiveInfinity; double value = 0.5 * (BEDS_d - ExpectedValue_d) * (MathNet.Numerics.SpecialFunctions.Erf( (lowerBound - ExpectedValue_d) * Math.Pow(Math.Sqrt(2 * Variance_d), -1)) - MathNet.Numerics.SpecialFunctions.Erf( (upperBound - ExpectedValue_d) * Math.Pow(Math.Sqrt(2 * Variance_d), -1))) + Math.Sqrt(Variance_d) * Math.Pow(Math.Sqrt(2 * Math.PI), -1) * (Math.Exp( -Math.Pow(lowerBound - ExpectedValue_d, 2) * Math.Pow(2 * Variance_d, -1)) - Math.Exp( -Math.Pow(upperBound - ExpectedValue_d, 2) * Math.Pow(2 * Variance_d, -1))); return(EBSResultElementFactory.Create( dIndexElement, (decimal)value)); }
public ISurgicalSpecialtyNumberAssignedOperatingRoomsResultElement Calculate( ISurgicalSpecialtyNumberAssignedOperatingRoomsResultElementFactory surgicalSpecialtyNumberAssignedOperatingRoomsResultElementFactory, IjIndexElement jIndexElement, Iw w) { return(surgicalSpecialtyNumberAssignedOperatingRoomsResultElementFactory.Create( jIndexElement, w.Value.Where(i => i.jIndexElement == jIndexElement && i.Value).Select(i => i.rIndexElement).Distinct().Count())); }
public Interfaces.Results.TP.WardBedOccupancyVariances.IVariance GetElementsAt( IVarianceResultElementFactory VarianceResultElementFactory, IVarianceFactory VarianceFactory, Iw w) { return(VarianceFactory.Create( w.Value .Select( i => VarianceResultElementFactory.Create( i, (decimal)this.GetElementAt( i))) .ToImmutableList())); }
public Constraint2( Iw w, IBEDS BEDS, ISPy y) { Expression LHS = Expression.Sum( w.Value .Select( i => y.Value[i])); int RHS = BEDS.Value.Value.Value; this.Value = LHS <= RHS; }
public Interfaces.Results.TP.WardSpareBeds.IδPlus GetElementsAt( IδPlusResultElementFactory δPlusResultElementFactory, IδPlusFactory δPlusFactory, Iw w) { return(δPlusFactory.Create( w.Value .Select( i => δPlusResultElementFactory.Create( i, (decimal)this.GetElementAt( i))) .ToImmutableList())); }
public Interfaces.Results.TP.WardNumberBedAssignments.ITPy GetElementsAt( ITPyResultElementFactory yResultElementFactory, ITPyFactory yFactory, Iw w) { return(yFactory.Create( w.Value .Select( i => yResultElementFactory.Create( i, this.GetElementAt( i))) .ToImmutableList())); }
public ISurgicalSpecialtyNumberAssignedOperatingRooms Calculate( ISurgicalSpecialtyNumberAssignedOperatingRoomsResultElementFactory surgicalSpecialtyNumberAssignedOperatingRoomsResultElementFactory, ISurgicalSpecialtyNumberAssignedOperatingRoomsFactory surgicalSpecialtyNumberAssignedOperatingRoomsFactory, ISurgicalSpecialtyNumberAssignedOperatingRoomsResultElementCalculation surgicalSpecialtyNumberAssignedOperatingRoomsResultElementCalculation, Ij j, Iw w) { return(surgicalSpecialtyNumberAssignedOperatingRoomsFactory.Create( j.Value .Select(i => surgicalSpecialtyNumberAssignedOperatingRoomsResultElementCalculation.Calculate( surgicalSpecialtyNumberAssignedOperatingRoomsResultElementFactory, i, w)) .ToImmutableList())); }
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; }
public Iw Create( ImmutableList <IwIndexElement> value) { Iw index = null; try { index = new w( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(index); }
public Iw Create( VariableCollection <IjIndexElement, IrIndexElement> value) { Iw variable = null; try { variable = new w( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(variable); }
public Iw Create( ImmutableList <IwResultElement> value) { Iw result = null; try { result = new w( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(result); }
public Iw Create( ImmutableList <IwParameterElement> value) { Iw parameter = null; try { parameter = new w( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(parameter); }
public IEBS Calculate( IEBSResultElementFactory EBSResultElementFactory, IEBSFactory EBSFactory, IEBSResultElementCalculation EBSResultElementCalculation, Id d, Iw w, IBEDS BEDS, Iμ μ, IVariance Variance) { return(EBSFactory.Create( d.Value .Select(y => EBSResultElementCalculation.Calculate( EBSResultElementFactory, y, w, BEDS, μ, Variance)) .ToImmutableList())); }
public Constraints5UConstraintElement( IjIndexElement jIndexElement, IrIndexElement rIndexElement, IsIndexElement sIndexElement, Interfaces.Parameters.SurgicalSpecialtyNumberAssignedTimeBlocks.IB BBar, Interfaces.Parameters.SurgeonNumberAssignedTimeBlocks.IB Bs, Iw w, Iy y) { Expression LHS = Bs.GetElementAtAsint( sIndexElement) * y.Value[sIndexElement, rIndexElement]; Expression RHS = BBar.GetElementAtAsint( jIndexElement) * w.Value[jIndexElement, rIndexElement]; this.Value = LHS <= RHS; }
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; }
public IConstraint2 Create( Iw w, IBEDS BEDS, ITPy y) { IConstraint2 constraint = null; try { constraint = new Constraint2( w, BEDS, y); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(constraint); }
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); }