Use of the GAMS language question

Hi folks,
I’m trying to write a program that will allow me to make some
complicated comparisons. I have a set of shapes, each of which has
circles associated with it. I need to be able to compare each circle
in each shape to every circle in every other shape to make sure they
do not intersect (I have all the math there figured out for this).

For example, shape 1 has 3 circles, e1, e2, e3, and shape 2 has 2
circles, c1, and c2.

I need comparisons between e1 and c1, e1 and c2, e2 and c1, e2 and c2,
e3 and c1, and e3 and c2.

The circles of course have a parameter associated with them–radius.

Anyone know the appropriate data structures to use?
Thanks!

\

Phil,

If you have the sets arranged in a good way this should be pretty
easy. If you have all the circles in a set C (alias(C,c1,c2)) and you
have parameters or variables for the centers and radiuses then you can
do something like

equation separate(c1,c2);

separate(c1,c2)$[not sameas(c1,c2)] … edist(x(c1)-x(c2), y(c1)-y(c2))
=G= radius(c1)+radius(c2);

-Steve

On Tue, Feb 21, 2012 at 10:18 PM, Phil wrote:

Hi folks,
I’m trying to write a program that will allow me to make some
complicated comparisons. I have a set of shapes, each of which has
circles associated with it. I need to be able to compare each circle
in each shape to every circle in every other shape to make sure they
do not intersect (I have all the math there figured out for this).

For example, shape 1 has 3 circles, e1, e2, e3, and shape 2 has 2
circles, c1, and c2.

I need comparisons between e1 and c1, e1 and c2, e2 and c1, e2 and c2,
e3 and c1, and e3 and c2.

The circles of course have a parameter associated with them–radius.

Anyone know the appropriate data structures to use?
Thanks!


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.




– Steven Dirkse, Ph.D. GAMS Development Corp., Washington DC Voice: (202)342-0180 Fax: (202)342-0181 sdirkse@gams.com http://www.gams.com