0
votes

I'm very new in programming, but I'm working on a nurse assignment model in Cplex Optimization. The first assignment should provide an initial feasible solution.

For this, I already defined the Variables of Nurses, Cases and Roles.

int i =  ... ;
range nurses = 1..n ;               // Set of available nurses

{string} roles  = ... ;             // Set of roles that are required for each surgery

int c = ... ;
range cases = 1..c ;                    // Set of cases scheduled for surgery n the current day

int cc = ... ;
range overlapcases = 1..cc ;            // Overlapping cases

Now I want to define the parameters (E equals epsilon):

P10 [i][c][k] : 1 if nurse iEI can do role kEK for case cEC, otherwise O

ST [c] : starting time of case cEC

ET [c] : ending time of case cEC

P11 [c][cc] : 1 if case cEC and case ccEC overlap, 0 otherwise

How can I formulate/define these parameters to get the results from CPLEX? Or do I have to write results in the datafile?

Actually I don't have any data for this problems. All data would be imaginary. I think, I have to write the data for Starting and Ending time, but I don't know how to handle the P10, P11.

My idea was (and I know it's not working):

boolean P10 [nurses][roles][cases] ;            // Amount of suitable nurses
int ST [cases] = ... ;
int ET [cases] = ... ;
boolean P11 [cases][overlapcases] ;

Anybody here who could help me? Thank you very much in advance. Regards.

1

1 Answers

0
votes

To read from a .dat let me give you a small example.

.mod

{string} nurses=...;
{string} roles=...;
{string} cases=...;
{string} overlapcases=...;

int P10 [nurses][roles][cases]=... ;            // Amount of suitable nurses
int ST [cases] = ... ;
int ET [cases] = ... ;
int P11 [cases][overlapcases] =...;

.dat

nurses={"Ann","Mary"};
roles={"A","B"};
cases={"C1","C2"};
overlapcases={"D1"};

P10= [[[1 0][0 1]][[1 0][0 1]]];            
ST  =[1,10] ;
ET  = [4,12];
P11 =[[1]];

PS: You have many examples in the CPLEX product and even a nurse example.