LotSizingDataModel.Checker 2.0.1
Reusable validation engine for structural, mathematical and objective consistency checks.
Loading...
Searching...
No Matches
ProductionSetupFamilyDerivedSemantics.cs
Go to the documentation of this file.
1using System;
2using System.Linq;
3using LotSizingDataModel.Core;
4using LotSizingDataModel.Core.Relationships;
5using LotSizingDataModel.Solution;
6
8
10{
11 public static bool IsFamilySetupActivated(
12 SupplyChain supplyChain,
13 LotSizingSolution solution,
14 ProductionSetupFamily family,
15 int period)
16 {
17 ArgumentNullException.ThrowIfNull(supplyChain);
18 ArgumentNullException.ThrowIfNull(solution);
19 ArgumentNullException.ThrowIfNull(family);
20
21 int[] routingIds =
22 supplyChain.ProductionRoutings
23 .Where(routing =>
24 family.MemberItemIds.Contains(routing.ItemId) &&
25 routing.WorkCenters.Any(reference =>
26 reference.PlantId ==
27 family.WorkCenter.PlantId &&
28 reference.WorkCenterId ==
29 family.WorkCenter.WorkCenterId))
30 .Select(routing => routing.Id)
31 .ToArray();
32
33 return solution.ProductionDecisions.Any(
34 decision =>
35 routingIds.Contains(decision.RoutingId) &&
36 decision.IsSetupActivated(period));
37 }
38
40 SupplyChain supplyChain,
41 LotSizingSolution solution,
42 ProductionSetupFamily family,
43 int period)
44 {
46 supplyChain,
47 solution,
48 family,
49 period)
50 ? family.SetupTime?[period] ?? 0.0
51 : 0.0;
52 }
53}
static double GetFamilySetupCapacityConsumption(SupplyChain supplyChain, LotSizingSolution solution, ProductionSetupFamily family, int period)
static bool IsFamilySetupActivated(SupplyChain supplyChain, LotSizingSolution solution, ProductionSetupFamily family, int period)