Defining parameter and writing constraint

43 views Asked by At

I want to define a parameter Aicp - capacity of supplier I for part c in period p. There are 5 suppliers (i), 3 parts (c), and 6 periods (p)

This is the way I defined:

.mod file

tuple capacity3
{
    key int sup;
    key int comp;
    key int peri;
    int val3;
}

{capacity3}aa=...;

.dat file

aa={<1,1,1,620>,<1,1,2,610>,<1,1,3,630>,<1,1,4,620>, ..........

Also I have written the constraint where this parameter as:

item(aa,<i,c,p>).val3; // where aa denotes the value of Aicp

I am still not getting the right answer. Where is my mistake?

1

There are 1 answers

0
Alex Fleischer On

Yes, item should work:

int val=item(aa,<1,1,3>).val3;

execute
{
  writeln(val);
}

This gives:

630