[FlopCpp] Algebraic modelling language integrated in C#

yo yo yoyovicks at yahoo.fr
Mon Feb 25 08:09:42 EST 2008


Hello,

Few weeks ago, I was looking for an Algebraic modelling languageintegrated in C# for GLPK rather than MathProg. I have found one forC++ called FlopC++.
I spent a lot of time and could not get it working. It is too muchcomplicated to write something right, there is no error messages, anddocumentation is quite poor.
Finally I gave up.
However, the Idea of redefining operators and using templates to adaptthe C syntax to something more mathematical is quite good and it isalso possible in C#.
The other thing is the OSI interface to call a broad range of solver, it is also very good.

Then I decided to craft something in pure C# for GLPK first, that I called FlopC#.
 Here are some examples of what is possible with my language:

            FCS_Set SITE = new FCS_Set("SITE");
            SITE.Add(6);
            FCS_Set PRODUCTS = new FCS_Set("PRODUCTS");
            PRODUCTS.Add(4);

            FCS_Subset STOCKABLE = new FCS_Subset(SITE, PRODUCTS);
            STOCKABLE.Add(SITE["SITE1"], PRODUCTS["PRODUCTS3"]);
  

            FCS_Constraint stockmax = new FCS_Constraint(STOCKABLE);
            FCS_Index s = new FCS_Index();
            FCS_Index p = new FCS_Index();
            FCS_Variable stock = new FCS_Variable(STOCKABLE);
            FCS_Variable import = new FCS_Variable(STOCKABLE);
            
              //here is where i write constraints like flopc++
            stockmax[s] =  3 * stock[s] + import[s]<=4;  //will generate constraints for each element of STOCKABLE
            stockmax[STOCKABLE[s,p]] = 3 * stock[STOCKABLE[s,p]] + import[s] == 4;
            

            FCS_Model model = new FCS_Model();
            model.AddConstraints(stockmax);
            model.CreateProblem();
            model.Minimise(import[s]);

I just started yesterday so for the moment I have just put in place base blocks.
Quite a lot of works is needed to get something usable.
I didn't release the code yet, but If there are some people interested in working on or using it, please let me know.

Thanks,
YO.



      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr



More information about the FlopCpp mailing list