[AMPL 1867] fix command

View: New views
2 Messages — Rating Filter:   Alert me  

[AMPL 1867] fix command

by Mushi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I have been using the fix command in my data file to set certain
binary variables to zero. For example
fix x[118,40,1]:= 0;
and suppose var x{i in N, j in N, v in V}binary; (v are vehicles)

I would like to be able to put something like
fix x[118,40,*]:= 0;
so that I could say for any vehicle, 118-40 is zero, without listing
all the combinations of the vehicles.

Is this possible?

Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


[AMPL 1868] Re: fix command

by Eli Olinick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The fix command can be indexed like a variable declaration or constraint.

So, you can use a command such as the following:

fix {v in V} x[118,40,v] := 0;

On Tue, July 8, 2008 15:03, Mushi said:

>
> I have been using the fix command in my data file to set certain
> binary variables to zero. For example
> fix x[118,40,1]:= 0;
> and suppose var x{i in N, j in N, v in V}binary; (v are vehicles)
>
> I would like to be able to put something like
> fix x[118,40,*]:= 0;
> so that I could say for any vehicle, 118-40 is zero, without listing
> all the combinations of the vehicles.
>
> Is this possible?
>
> Thanks in advance.
>
> >
>


Eli

------------------------------------------------
Eli V. Olinick
Associate Professor
Department of Engineering Management, Information, and Systems
School of Engineering
Southern Methodist University
PO Box 750122
Dallas, TX  75275-0123

Vox: (214) 768 3092
Fax: (214) 768 1112

Operations Research: the Science of Better
http://www.scienceofbetter.org



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price!