Skip to main content

Dear All,

I want to model a variable that only can be applied for certaint set index. For example:

Variable NPGMax {
    IndexDomain: (i,g,ng)|ord(i) = 1 or ord(i) = 3 or ord(i) = 6;
}

where the variable NPGMax is only applied for index 1, 3, or 6 of set bus with index i.

Is it possibel to do it dynamiclly where the value 1,3, or 6 can be assigned as an input parameter?

Thank you very much.

Hi @rahmat , 

 

I recommend you to declare a binary parameter indexed over your set, say BP_SelectedVariables(i), and apply this parameter in the domain condition of your variable:

Parameter BP_SelectedVariables {
    IndexDomain: (i);
    Range: binary;
}

Variable NPGMax {
    IndexDomain: (i,g,ng)| BP_SelectedVariables(i)
}

This BP_SelectedVariables can then be updated through an assignment in a procedure, or directly in your user interface (it will show some checkboxes)

As soon as BP_SelectedVarialbles is updated, the variable is updated too.


Hi @Arthur,

Many thanks for your suggestion. It works well…

Thank you.


Hello @Arthur,

Based on your reply, the approach can be used to substitute the compound set (that no longer supported by AIMMS). For example:

Set Bus {
    Index: i
}

Set GenTech {
    Index: g;
}

Set GenNum {
    Index: ng;
}

Set NewGen {
    SubsetOf: (Bus, GenTech);
    Index: cg;
}

Variable NPGMax {
    IndexDomain: (cg,ng);
    Range: integer;
}

can be replaced by:

Parameter NewGenBus {
   IndexDomain: (i,g);
   Range: binary;
}

Variable NPGMax {
    IndexDomain: (i,g,ng) | NewGenBus(i,g)
    Range: integer;
}

Is this correct?


Based on your reply, the approach can be used to substitute the compound set (that no longer supported by AIMMS). For example:

 

@rahmat , yes. The binary parameter acts as a condition to generate the valid tuples. NewGenBus(Bus1, GenTech1) = 1 indicates that NewGen is possible with i = Bus1 and g = GenTech1


Based on your reply, the approach can be used to substitute the compound set (that no longer supported by AIMMS). For example:

 

@rahmat , yes. The binary parameter acts as a condition to generate the valid tuples. NewGenBus(Bus1, GenTech1) = 1 indicates that NewGen is possible with i = Bus1 and g = GenTech1

@mohansx, thanks a lot...


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator