This shows you the differences between two versions of the page.
en:dev:initialisation_mkt [2017/03/21 13:15] Antonello Lobianco |
en:dev:initialisation_mkt [2018/06/18 16:45] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | This is the workflow of the model in the first few years. | ||
- | |||
- | '' | ||
- | pp -> primary products; | ||
- | tp -> transformed products; | ||
- | r -> region; | ||
- | t -> time'' | ||
- | |||
- | $pl_{r, | ||
- | |||
- | $dl_{r, | ||
- | |||
- | $st_{r, | ||
- | |||
- | $dt_{r, | ||
- | |||
- | $ q1_{r, | ||
- | |||
- | ModelCoreSpatial:: | ||
- | msgOut(MSG_INFO, | ||
- | |||
- | for(uint i=0; | ||
- | int r2 = regIds2[i]; | ||
- | |||
- | |||
- | |||
- | // q1(i, | ||
- | // p1(i, | ||
- | // RPAR(' | ||
- | // RPAR(' | ||
- | // RPAR(' | ||
- | // RPAR(' | ||
- | // K(i, | ||
- | for(uint sp=0; | ||
- | double psi = gpd(" | ||
- | double dl = gpd(" | ||
- | double da = gpd(" | ||
- | double pl = gpd(" | ||
- | double sl = gpd(" | ||
- | double k1 = gpd(" | ||
- | double pWo = gpd(" | ||
- | |||
- | |||
- | double q1 = 1/ ( 1+pow(dl/ | ||
- | double p1 = 1-q1; | ||
- | double dc = pow( | ||
- | q1*pow(da, | ||
- | , | ||
- | psi/(psi-1) | ||
- | ); | ||
- | double pc = (da/dc)*pWo | ||
- | | ||
- | double pw = (dl*pl+da*pWo)/ | ||
- | double k = k1*sl; | ||
- | |||
- | spd(q1," | ||
- | // | ||
- | spd(dc," | ||
- | spd(pc," | ||
- | spd(pw," | ||
- | spd(k," | ||
- | } | ||
- | |||
- | // t1(i, | ||
- | // r1(i, | ||
- | // RPAR(' | ||
- | // RPAR(' | ||
- | // RPAR(' | ||
- | for(uint pp=0; | ||
- | |||
- | double sl = gpd(" | ||
- | double sa = gpd(" | ||
- | double eta = gpd(" | ||
- | double pl = gpd(" | ||
- | double pWo = gpd(" | ||
- | |||
- | |||
- | double t1 = 1/ ( 1+(pow(sl/ | ||
- | double r1 = 1-t1; | ||
- | double sc = pow( | ||
- | | ||
- | , | ||
- | | ||
- | ); | ||
- | double pc = (sa/ | ||
- | double pw = (sl*pl+sa*pWo)/ | ||
- | |||
- | spd(t1," | ||
- | // | ||
- | spd(sc," | ||
- | spd(pc," | ||
- | spd(pw," | ||
- | } | ||
- | |||
- | // up to here tested with gams output on 20120628, that's fine !! | ||
- | } // end for each region in level 2 | ||
- | |||
- | |||
- | // initializing the exports to zero quantities | ||
- | // initializing of the transport cost for the same region to one and distance to zero | ||
- | for(uint r1=0; | ||
- | for(uint r2=0; | ||
- | for(uint p=0; | ||
- | for(uint r2To=0; | ||
- | spd(0," | ||
- | if(l2r[r1][r2] == l2r[r1][r2To]){ | ||
- | spd(1," | ||
- | } | ||
- | } | ||
- | } // end each product | ||
- | |||
- | for(uint r2To=0; | ||
- | if(l2r[r1][r2] == l2r[r1][r2To]){ | ||
- | spd(0," | ||
- | } | ||
- | } | ||
- | } // end of r2 regions | ||
- | } // end of r1 region | ||
- | } | ||
- | |||
- | |||
- | |||
- | |||