« Return to Thread: [AMPL 2624] Defining a variable domain

[AMPL 2624] Defining a variable domain

by Amadeus-5 :: Rate this Message:

Reply to Author | View in Thread


Hi all,

I have two questions.

1. In this expression, I would like to allow the variables A to have
values of either -1 or 1.

var A{i in 1..10} integer >= -1.0, <= 1.0;

This would definitely not work because A \in {-1,0,1}
How can I do it?


2.  Assume that B is a variable defined in 4 dimension discrete space.
Specifically, B \in {-1,1}^4
I would like to restrict its domain to (1,1,1,1) (1,1,-1,-1) and
(-1,-1,-1,-1).
Is there any valid AMPL expression for this?

Thanks!
I appreciate your help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: [AMPL 2624] Defining a variable domain