Last active
August 29, 2015 13:57
-
-
Save josejuan/9794546 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Para cada par de checkpoints U y V (en cada par de días consecutivos) su arista es | |
// seleccionada, si los dos están seleccionados, es decir un AND: | |
// | |
// UV = U & V | |
// | |
let edges = [ | |
for d in [0..ndays - 2] do | |
for uv in E.[d] do | |
yield let lookup w (i : CheckPoint) = C.[d + w].First(fun k -> k.cp.CPId = i.CPId).v | |
in (uv.v, lookup 0 uv.a, lookup 1 uv.b, distance uv.a uv.b)] | |
// RESTRICCION #10 | |
model.AddConstraints [ | |
for (ev, av, bv, dst) in edges do | |
yield! [ ev <= av; ev <= bv; av + bv - 1. <= ev | |
; userp.MinDayDistance * ev <= dst | |
; dst * ev <= userp.MaxDayDistance ]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment