Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Moving LineIterator back and forth

    Posted 12/26/11 10:12 AM

    Originally posted by: anahana


    Hi,

    I'm using an instance of LineIterator to read data from a .csv file, I use the (++) to move the iterator to the next record in the file, but is there a way to move the iterator back to a previous record? I tried (--) and got an error that it was not a defined operator.

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Moving LineIterator back and forth

    Posted 12/26/11 11:25 AM

    Originally posted by: SystemAdmin


    Hello.

    LineIterator classes (i.e. IloCsvReader::LineIterator and IloCsvTableReader::LineIterator) do not support going back. However to access the lines in non-sequential order you can use functions getLineByNumber and getLineByKey on classes IloCsvReader and IloCsvTableReader. Note that in this case it is better to create the reader as cached, see parameter isCached in constructor of IloCsvReader.

    Best regards, Petr
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Moving LineIterator back and forth

    Posted 12/26/11 12:28 PM

    Originally posted by: anahana


    Works very well. Thanks.
    #CPOptimizer
    #DecisionOptimization