Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Ranges

    Posted Tue May 20, 2008 01:25 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    hi,
    i have  the following declaration in my opl model:

    [b]range Trips = 0..card(RawTimetable)+card(Location)-1;
    int Origin[trips] = ...; [/b]

    when i try to assign this variable from my c# code by implementing the CustomOplDataSource class, it give me an error (variable dosnt exist),but when i change the declaration as following:
    int [b]Origin[0..81] = ...;[/b] it works, my problem is how i can make it dynamic, i mean to declare the range by using a variable ([0..x]) and not a number ([0..81])???

    thank you

    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: Ranges

    Posted Wed May 21, 2008 01:28 PM

    Originally posted by: SystemAdmin


    [afleischer said:]

    Hi,

    if you want to set some data thru CustomOplDataSource, then this data has to be defined in the .dat and not only in the .mod as you have experienced.

    Can't you try to have

    int maxRangeTrips=...;
    range Trips=0..maxRangeTrips;

    and you set maxRangeTrips thru  CustomOplDataSource

    Alex

    #ConstraintProgramming-General
    #DecisionOptimization