Good day, please I need help to establish relationship between sets but I don't know how to go about it. It's a job scheduling problem.
An example is shown below.
Sets
j Current job /j1*j10/
h last job before the current /h1*h10/
I want to establish a relationship between h and j such a the relationship shown below. If the current job is J6 and it has finish processing and the next job is j2. While on job 6 set j is 6 but immediately it starts processing job 2, set j will pass its old value to h as 6 and the current job will have set j as 2.
h = ord (j)-1. (I don't know if this correct)
I want to express last job in terms of the current job. I don't even if this relationship is expressed as set, parameter or what.?
Thanks.
Create relationship between sets
-
- User
- Posts: 6
- Joined: 3 years ago
Create relationship between sets
Last edited by adeniyi4adisa 3 years ago, edited 1 time in total.
-
- User
- Posts: 6
- Joined: 3 years ago
Re: Create relationship between sets
adeniyi4adisa wrote: ↑3 years ago Good day, please I need help to establish relationship between sets but I don't know how to go about it. It's a job scheduling problem.
An example is shown below.
Sets
j Current job /j1*j10/
h last job before the current /h1*h10/
I want that, if job 6 is the current job and job 2 was the last one, my model will be able to pass the last job to h and the current job will be j.
I want to establish a relationship between h and j such a the relationship shown below.
h = ord (j)-1. (I don't know if this correct)
I want to express last job in terms of the current job. I don't even if this relationship is expressed as set, parameter or what.?
Thanks.
Re: Create relationship between sets
Hi
You are aware that you can write j-1 as index?
Cheers
Renger
You are aware that you can write j-1 as index?
Code: Select all
set j /j1*j10/;
parameter Job(j), Previousjob(j)
PreviousJob(j) = Job(j-1);
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
-
- User
- Posts: 6
- Joined: 3 years ago
Re: Create relationship between sets
Thanks renger, you have been of great help to me. Though I have not finished working on your guide but it proved helpful.
-
- User
- Posts: 6
- Joined: 3 years ago
Re: Create relationship between sets
Hi Ranger, I have tried the guide you gave me. It did not work. It seems the analysis works only on parameters not on sets. I need a way to manipulate these sets in order to achieve the desired result. I have tried to manipulate from the equations but to no avail because the domain will become meaningless.
Looking forward to hearing from you.
Thanks.
Looking forward to hearing from you.
Thanks.