LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
ObjectiveCriterionExecutionSpecification.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
4
6
7/// <summary>
8/// Specifies one executable criterion in a multiobjective policy.
9/// </summary>
10/// <remarks>
11/// The criterion kind is generic. Weight and priority are explicit source data
12/// and are never inferred from list position or naming conventions.
13/// </remarks>
14[Serializable]
15[XmlType(TypeName = "objectiveCriterionExecutionSpecification")]
18{
19 private OptimizationObjectiveKind _kind =
21
22 private double _weight = 1.0;
23 private int _priority;
24 private double _absoluteTolerance;
25
26 [XmlAttribute("kind")]
28 {
29 get => _kind;
30 set => SetProperty(ref _kind, value);
31 }
32
33 [XmlAttribute("weight")]
34 public double Weight
35 {
36 get => _weight;
37 set
38 {
39 if (!double.IsFinite(value) || value <= 0.0)
40 {
41 throw new ArgumentOutOfRangeException(
42 nameof(value),
43 value,
44 "An executable objective weight must be finite and strictly positive.");
45 }
46
47 SetProperty(ref _weight, value);
48 }
49 }
50
51 [XmlAttribute("priority")]
52 public int Priority
53 {
54 get => _priority;
55 set
56 {
57 if (value < 0)
58 {
59 throw new ArgumentOutOfRangeException(
60 nameof(value),
61 value,
62 "Objective priority cannot be negative.");
63 }
64
65 SetProperty(ref _priority, value);
66 }
67 }
68
69 [XmlAttribute("absoluteTolerance")]
70 public double AbsoluteTolerance
71 {
72 get => _absoluteTolerance;
73 set
74 {
75 if (!double.IsFinite(value) || value < 0.0)
76 {
77 throw new ArgumentOutOfRangeException(
78 nameof(value),
79 value,
80 "Lexicographic tolerance must be finite and non-negative.");
81 }
82
83 SetProperty(ref _absoluteTolerance, value);
84 }
85 }
86}
Base class for model objects that notify listeners when one of their properties changes.
OptimizationObjectiveKind
Business-level optimization criterion family.