Topic
• 6 replies
• Latest Post - ‏2013-06-20T09:59:09Z by rdumeur
ouss
4 Posts

# Pinned topic (Such as) expression in Cplex optimizer help

‏2013-05-15T14:02:00Z |

Hello everybody

At the moment I am trying to program a code for operating room scheduling .. I have one problem that one of my constraints requires to code the expression ( such as)  but I do not know how to do it on OPL Cplex optimizer .. When I run the program the following message appears

[ decision variable (or expression) Fd is not authorized ]

Please look at the attached files for the Cplex code and the mathematical expression of the constraint

Bearing in mind that       Fd(i)      is a decision variable and     dur(i)  and     d   are parameters

It is urgent for me and thank you in advance for your kind help

#### Attachments

Updated on 2013-05-15T14:17:21Z at 2013-05-15T14:17:21Z by ouss
• AlexFleischer
200 Posts

#### Re: (Such as) expression in Cplex optimizer help

‏2013-05-16T10:57:08Z

Hi,

Fd is a decision variable so you can not use it in slicing.

What you can do is write the slicing as an expression  like (Fd[d]+dur[i]==d) * L[i] in your sum

regards

• ouss
4 Posts

#### Re: (Such as) expression in Cplex optimizer help

‏2013-05-16T15:06:34Z

Hi,

Fd is a decision variable so you can not use it in slicing.

What you can do is write the slicing as an expression  like (Fd[d]+dur[i]==d) * L[i] in your sum

regards

Thank you AlexFleischer for your help.

I just want to know, this expression "Fd[i]+dur[i]==d" means that only the operations 'i' that have their competion time plus the length of stay of the patient who have submitted the operation 'i' who coincides with the date 'd' are only considered.

regards

Updated on 2013-05-16T15:06:53Z at 2013-05-16T15:06:53Z by ouss
• AlexFleischer
200 Posts

#### Re: (Such as) expression in Cplex optimizer help

‏2013-05-16T19:11:05Z
• ouss
• ‏2013-05-16T15:06:34Z

Thank you AlexFleischer for your help.

I just want to know, this expression "Fd[i]+dur[i]==d" means that only the operations 'i' that have their competion time plus the length of stay of the patient who have submitted the operation 'i' who coincides with the date 'd' are only considered.

regards

hi

yes since in other cases (Fd[d]+dur[i]==d) will be 0

regards

• ouss
4 Posts

#### Re: (Such as) expression in Cplex optimizer help

‏2013-05-17T07:51:30Z

hi

yes since in other cases (Fd[d]+dur[i]==d) will be 0

regards

Thank you AlexFleischer for your help

• ouss
4 Posts

#### Re: (Such as) expression in Cplex optimizer help

‏2013-06-18T14:24:03Z
• ouss
• ‏2013-05-17T07:51:30Z

Thank you AlexFleischer for your help

hi,

Even the expression (Fd[d]+dur[i]==d) * L[i] was not accepted, because Fd[d] is a decision variable.

Please, is there another solution?

Please look at the attached file for the Cplex code of the constraint

regards.

• rdumeur
81 Posts

#### Re: (Such as) expression in Cplex optimizer help

‏2013-06-20T09:59:09Z
• ouss
• ‏2013-06-18T14:24:03Z

hi,

Even the expression (Fd[d]+dur[i]==d) * L[i] was not accepted, because Fd[d] is a decision variable.

Please, is there another solution?

Please look at the attached file for the Cplex code of the constraint

regards.

Hi,

I suspect there must be a problem somewhere else. It is very strange that a decision variable cannot appear in a constraint. Could you please post your model (in text, not png) so that we can try reproduce your problem?

Cheers,