Parameters

I want to make a profit parameter p(i,j) and another parameter y(i,j)

p(i,j) is equal to 2 if i + j is even, and is equal to 1 if i + j is even

y(i,j) is to 0 with probability 0.8 and 50 with probability 0.2

How do I write both parameters?

set i /1*20/; alias (i,j);
parameter p(i,j), y(i,j);
p(i,j) = 2;
p(i,j)$mod(i.val+j.val,2) = 1;
y(i,j)$(uniform(0,1)<=0.2) = 50;

-Michael

Hi,

A parameter has population data from 2023 to 2050.

How do I display just the population in 2050 or reference just the 2050 population for my next code?

-Don

How is this related to this thread? Any how, here is some solution:

set y / 2023*2050 /;
parameter pop(y);
pop(y) = uniformInt(10,100);
scalar pop2050; pop2050 = pop('2050'); display pop2050;

-Michael

Thank you