Forum Discussion
FICO
5 years agoCommunity Manager
mpvar variables and identifiers
Hi, Is it possible to sum a mpvar and an integer variable into an index of another mpvar ? Example: declarations
x: array(1..10,1..5) of mpvar
y: mpvar
end-declarations
y is_integer
y <= 2
fo...
FICO
5 years agoCommunity Manager
I would suggest to work with additional variables representing the actual values per task that are selected via the 'Start' (-> 'ifstart') and 'Finish' (-> 'iffinish') variables - assuming that one of these is meant to be non-zero per task, being defined as binaries or SOS-1:
declarations
ifstart: array(1..nTask, 1..nTime) of mpvar ! Start time selectors ('Start')
iffinish: array(1..nTask, 1..nTime) of mpvar ! Completion time selectors ('Finish')
tstart: array(1..nTask) of mpvar ! Start time value per (aggregation of 'ifstart' per task)
tfinish: array(1..nTask) of mpvar ! Completion time (aggregation of 'iffinish' per task)
wait: array(1..nTask) of mpvar ! Variable time in between start and finish
end-declarations
forall(i in 1..nTask) do
! ... define ifstart and iffinish as binary or as one SOS-1 per task ...
sum(j in 1..nTime) ifstart(i,j) = 1
sum(j in 1..nTime) j*ifstart(i,j) = tstart(i)
sum(j in 1..nTime) iffinish(i,j) = 1
sum(j in 1..nTime) j*iffinish(i,j) = tfinish(i)
tstart(i) = tfinish(i)+wait(i) ! The actual relation to be stated
end-do
Note that I have changed the name of the array from 'time' to 'wait' in order to avoid any clashes with the type 'time' that is defined by the Mosel module 'mmsystem'.
Related Content
Related Content
I have an optimization model where setting certain variables can lead to constraint violations. Is there a way to identify and remove all infeasible constraints before solving the model?
1 year agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2CommentsVariable names in callback (Java API)
I construct a cut in a preintsol callback using variables from the model containing the callback. When constructing the model, I give the variables names (using withName(...)) and store them in a vec...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum4 unread comments4 unread1View0likes4CommentsMPVAR mod integer
Hi all, I'm wondering is it possible to modulo an mpvar. I have a set of mpvars Xs which are binary and I want to have Sum(i in set) Xi mod 2 = 0 (in other words), the sum of the binary variabl...9 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2Comments