xor
function xor(c1:log_or_linctr,c2:log_or_linctr):logctr
c1
|
A linear constraint (
linctr) or logical expression (
logctr)
|
c2
|
A linear constraint (
linctr) or logical expression (
logctr)
|
declarations R=1..2 C: array(range) of linctr ! Linear constraints L: logctr ! Logical constraint s: array(R) of mpvar ! Decision variables (start times) D: array(R) of real ! Data (durations) end-declarations C(1):= s(1)+D(1)>=s(2) ! Define (temporary) linear constraints C(2):= s(2)+D(2)>=s(1) xor(C(1), C(2)) ! State an exclusive 'or' forall(j in 1..2) C(j):=0 ! Delete the auxiliary constraints ! The same 'xor' constraint can be stated by: xor(s(1)+D(1)>=s(2), s(2)+D(2)>=s(1)) ! A non-exclusive 'or' relation is stated by using the 'or' operator: L:= s(1)+D(1)>=s(2) or s(2)+D(2)>=s(1)
uses 'advmod'
© 2001-2022 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.