Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Incrementing the iteration

ALEX FLEISCHER

ALEX FLEISCHERTue September 19, 2017 08:59 AM

  • 1.  Incrementing the iteration

    Posted Tue September 19, 2017 08:23 AM

    Originally posted by: felycite28


    Hello everybody ,

    I have small question . How can I increment the iteration by 2 or 3 or more ? Is it possible or not ? let me give you an example :

    a  = 1;

    main

    {

    while(a<5)
     {
    do that
    a++
    }

    }

    Instead of  incrementing "a" by 1 , I want to increment it by 2 ? Is it possible ? If so , how?

     

    Thank you in advance

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Incrementing the iteration

    Posted Tue September 19, 2017 08:59 AM

    Hi

    a+=2;

    regards

    NB:

    main
    {
    for(var i=1;i<=10;i+=2) writeln(i);
    }

    gives

    1
    3
    5
    7
    9

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Incrementing the iteration

    Posted Tue September 19, 2017 10:12 AM

    Originally posted by: felycite28


    Thanks Alex ,

    I realised my mistake


    #DecisionOptimization
    #OPLusingCPLEXOptimizer