FLAME’s Future
265
price_inflation += current_message->priceinflation;
number_of_firms++;
current_message = get_next_priceinflation_message(current_message,
priceinflation_messages);
}
price_inflation = price_inflation / number_of_firms;
if(number_of_firms < m)
{
m = number_of_firms;
}
if(price_inflation < -0.05f) price_inflation = -0.05f;
if(price_inflation > 0.05f) price_inflation = 0.05f;
if(agent->firmid == 0)
{
agent->wage=agent->wage * ( 1.0 + price_inflation ) * ( 1.0 - 0.0);
}
else
{
agent->wage=agent->wage * ( 1.0 + price_inflation ) * ( 1.0 + 0.01);
}
/* Apply to a random Mall */
mall_chosen=floor(GetRandomNumber(1,MALLSNO+1,rand48));
if(mall_chosen > 0)
{
agent->mall_application=mall_chosen;
add_application_message(application_messages,agent->id,
agent->wage, agent->mall_application, MESSAGE_RANGE,
agent->x,agent->y, 0.0f);
}
else
{
agent->mall_application=0;
}
return 0;
}
/** \fn Person_2()
* \brief Update employment status*/
__FLAME_GPU_FUNC__ int Person_2(xmachine_memory_Person* agent,
xmachine_message_employed_list* employed_messages,
xmachine_message_consumer_spending_list* consumer_spending_messages,
RNG_rand48* rand48)
{
float random_no=rnd(rand48);
int mall_chosen=floor(GetRandomNumber(1,MALLSNO+1,rand48));
agent->firmid=0;
xmachine_message_employed* current_message =
get_first_employed_message(employed_messages);
while(current_message)
{
if(agent->id == current_message->person_id)
{
agent->firmid=current_message->firm_id;
}
current_message
= get_next_employed_message(current_message,employed_messages);
Précédent

- 294/329

Suivant