Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Syntax error, unexpected end of file

    Posted Mon April 04, 2016 01:30 PM

    Originally posted by: sdo30


    I am having this error problem ''unexpected end of file found in scripting''. Could you help please.(Or are there other likely errors not yet revealed?). File attached.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Syntax error, unexpected end of file

    Posted Tue April 05, 2016 02:12 AM

    Hi

    you should have a } for all {.

    For example, you main should be like

     main{
     var mod=thisOplmodel.modeDefinition;
     var dat=thisOplmodel.datElements;
     for(var size=5; size<=50; size+=5){
     var MyCplex=new IloCplex();
     var opl=new IloOplModel(mod,MyCplex);
     dat.n=size;
     opl.addDataSource(dat);
     opl.generate();
     if(MyCplex.solve()){
     writeIn("solution:",MyCplex.getObjvalue());
     writeIn("size:",MyCplex.getsize());
     writeIn("time:",MyCplex.getCplexTime());
    }
    opl.end();
    MyCplex.end();
    data.end();
    def.end();
    source.end();
    }
    }
    }

    Plus you should check that even without the main block, your model should work.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Syntax error, unexpected end of file

    Posted Tue April 05, 2016 10:47 AM

    Originally posted by: sdo30


    Thank you Alex, the unexpected end of file corrected. But other errors came up. More assistance please. File attached.

    Line11-13, corrected but error highlight still persist. Line 37,51,53,55,64,66 and 66 ( cannot use the float [POD][POD] with ''in''). How do I correct this?

    Line 37-40 (Name does not exist, corrected but error highlight still persist).

    Line 72 ,77 (cannot use the type float and type tuple respectively). How do I state them?

    Do I delete Line 78-82?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Syntax error, unexpected end of file

    Posted Wed April 06, 2016 03:20 AM

    Hi,

    many many errors.

    I commented nearly everything and my suggestion is you should uncomment line by line and fix errors.

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer