Solved

Discrete Uniform Distribution

  • 8 August 2022
  • 1 reply
  • 33 views

Badge +3

Hello everyone, 

 

Is there a way to use a discrete uniform distribution inside of Aimms? I know there is a uniform distribution but it gives me real number values for my parameter. Instead i just want integer values to be drawn from the uniform distribution. Is this possible? 

 

Thank you for an answer.

 

Kind regards

Alex

icon

Best answer by Chris Kuip 8 August 2022, 16:58

View original

1 reply

Userlevel 4
Badge +7

Hi Alex,

 

You can use round and uniform.  I created a small example as follows:

Procedure MainExecution {

    Body: {

        empty p_frequency ;

        while loopcount <= p_noDrawings do

            p_draw := uniform( -0.4999, 9.4999 );

            p_rndDraw := round( p_draw );

            ep_digit := p_rndDraw ;

            p_frequency( ep_digit ) += 1 ;

        endwhile ;

    }

    Parameter p_draw;

    Parameter p_rndDraw {

        InitialData: 10000;

    }

}

 


This example gives the following combination chart:

 

distribution of a million drawings

 

Hope this helps,

 

Chris.

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator