Sunday, September 12, 2004

Input configuration files for EMANS

At first, the configuration files, specifically, lp_in.conf looked like this:

# shows how the input will be asked
defaults=m:2,n:2
Title=t:title
no of variables=s:n
no of constraints=s:m
Objective Function=(f:c,"x")[n]
Constraints={(f:a,"x")[n],"GLE",f:b}[m]
lower-bound=(f:lval,"x"," ")[n]
upper-bound=(f:uval,"x"," ")[n]
Cords, Fritz, Lindsay, and Adrian, however, suggested another way to write it. That is, to make it more "expandable." The above configuration just works with up to two-dimensions. This is quite ideal, since the part i'm working on is the web interface, which would only have virtually up to two-dimensional input. However, one could devise a way to allow users to input data in n-dimensions, like having them input in multiple pages, or in multiple color schemes, etc...
Now, it looks like this:
# shows how the input will be asked
defaults=m:2,n:2
Title=t:title
no of variables=s:n
no of constraints=s:m
Objective Function=(f:c,"x",$n)[n:'ADD']
Constraints=((f:a,"x",$n)[n:'ADD'],"GLE",f:b)[m]
lower-bound=(f:lval,"x",$n," ")[n]
upper-bound=(f:uval,"x",$n," ")[n]
Notice that the braces "{}" are replaced by parenthesis "()" and at the part where you'd indicate the number of elements are in an array (the one enclosed by brackets "[]"), the "joining action" done to each element in that array. For this, each element - as indicated by 'ADD' - is added to each other.

0 Comments:

Post a Comment

<< Home