Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Initialization using indexed tuple

    Posted Thu August 09, 2018 04:43 AM

    Originally posted by: Eliosa


    Hello,

    Providing that I set some of my vessel fleet information such as: 

     

    {string} Vessels = ...;
    
    tuple VesselType{
            float MaxCap;
            float Ladden_BO;
            float Ballast_BO;
            float HFO;
            float MGO;
            float Pilot_Consumption[12..19];
            float Ladden_Consumption[12..19];
            float Ballast_Consumption[12..19];
            string Current_Location;
            float Current_Date;
            int Loaded;
     }
     
    VesselType VesselsInfo[Vessels]= ...;
    

    What is the proper way to create an array containing each "Current_Location" of all the vessels such as:

    tuple locationtest {
    float id;
    string loc;
    
    }
    locationtest locv = {0, t.Current_Location | t in VesselsInfo};
    

    Thanks a lot of the great help provided on this forum.

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Initialization using indexed tuple

    Posted Thu August 09, 2018 10:05 AM

    Originally posted by: Eliosa


    Any suggestion?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Initialization using indexed tuple



  • 4.  Re: Initialization using indexed tuple

    Posted Thu August 09, 2018 11:46 AM

    Originally posted by: Eliosa


    Thanks, but what I am trying to do is to create a {string} Location  which contains all the location of the different Vessels.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Initialization using indexed tuple

    Posted Thu August 09, 2018 11:55 AM

    {string} locations={v.currentLocation | v in Vessels};

     

    will do that

     

    regards

     

    https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Initialization using indexed tuple

    Posted Thu August 09, 2018 12:12 PM

    Originally posted by: Eliosa


    I was being silly, the answer I wanted was : {string} locations={VesselsInfo[v].Current_Location | v in Vessels};

    thanks for your help again ! 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer