-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MO Emulator: fix no-solution case #239
Don't recompute objectives when no solution available
- Loading branch information
Showing
9 changed files
with
6,403 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
test/end2end/cases/categorized/fast/iis_feasrelax/airtrainee_base.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
set I; # Trainees | ||
set T; # Training sessions | ||
set V{I} in T; # Valid sessions for each trainee | ||
set Pos; # Positons | ||
set PosPlus; # Meta-positions (e.g, All, Cockpit, Cabin) | ||
set MAXPlusWhich{Pos} in PosPlus; | ||
|
||
param P{I} in Pos; # Trainee's position | ||
param S{I}; # Seniority (smaller value <=> higher seniority) | ||
param L{I}; # Language (0 - both, 1 or 2 - one only) | ||
param E{I}; # Expiration: 0 - this month, 1 - next month, 2 - in 2 months | ||
param Pr{I, T}; # Priority: 0 - not wanted, larger value <=> higher preference | ||
param MAX{Pos}; # Position capacity | ||
param MAXPlus{PosPlus}; # Aggregated capacities (All, CK, CB) | ||
|
||
var x{i in I, t in T} binary <= if t in V[i] then 1 else 0; | ||
var y{i in I} binary <= if E[i]>0 then 1 else 0; # Trainee i unassigned | ||
var u{T} binary; # 1 <=> language 1, 0 <=> language 2 | ||
var w >=0; # Number of unassigned trainees | ||
|
||
s.t. Assign_E0 {i in I: E[i]==0}: | ||
sum {t in V[i]} x[i, t] == 1; | ||
|
||
s.t. Unassigned_E12 {i in I: E[i]>0}: | ||
sum {t in V[i]} x[i, t] + y[i] == 1; | ||
|
||
s.t. Sum_Unassigned: w == sum {i in I: E[i]>0} y[i]; | ||
|
||
s.t. Language_1 {t in T}: | ||
u[t]<0.5 ==> sum {i in I: L[i]==1 and t in V[i]} x[i, t] <= 0; | ||
|
||
s.t. Language_2 {t in T}: | ||
u[t]>=0.5 ==> sum {i in I: L[i]==2 and t in V[i]} x[i, t] <= 0; | ||
|
||
s.t. Capacity {p in Pos, t in T}: | ||
sum {i in I: p==P[i] and t in V[i]} x[i, t] <= MAX[p]; | ||
|
||
s.t. Capacity_Meta {p in PosPlus, t in T}: | ||
sum {i in I: p in MAXPlusWhich[P[i]] and t in V[i]} x[i, t] <= MAXPlus[p]; | ||
|
||
suffix objpriority; | ||
param S_range := max {i in I} S[i] - min {i in I} S[i]; | ||
|
||
# The primary objective | ||
minimize Total_Unassigned: w suffix objpriority 3*S_range + 1; | ||
# let Total_Unassigned.objpriority := card(I) + 3; | ||
|
||
# Trainee preferences, ranked by seniority | ||
set SenLevels := setof {i in I} S[i]; | ||
param prefMax {i in I} := max {t in V[i]} Pr[i, t]; | ||
minimize PrefViolRanked {s in SenLevels}: | ||
sum {i in I: s==S[i]} | ||
(1.0 # penalty 1 for non-assignment | ||
- sum {t in V[i]: Pr[i, t]>0} | ||
Pr[i, t] / prefMax[i] # normalize | ||
* x[i, t] | ||
+ sum {t in V[i]: Pr[i, t]==0} x[i, t]) # penalty 2 for unwanted assignment | ||
suffix objpriority max {j in I} S[j] + 2*S_range + 1 - s; |
Oops, something went wrong.