Agents in Social Science
105
(sugar_location_message->x-X)*(sugar_location_message->x-X) +
(sugar_location_message->y-Y)*(sugar_location_message->y-Y);
if(current_distance_squared <=
(citizen_view_length* citizen_view_length))
{
if(current_distance_squared
{
FLAG_SUGAR_FOUND=closest_sugar_id; //Agent memory saves this id
//"Sugar is found"
}
}
}
sugar_location_message=get_next_sugar_location_message
(sugar_location_message);
}
The next function can then use its memory values to determine if it needs
to interact with sugar agents in the iteration.
a.flag_sugar_found
EQ
0
5.1.5 Handle Multiple ‘Eaten’ Requests
By recording the ID of the sugar agent closest to the citizen agent, the
citizen can then choose which sugar to interact with. When the sugar agents
then read these ‘request’ messages, they can choose one of the agents and be
‘eaten’ by one.
5.1.6 Change Starting Conditions
The experiment can be repeated with different starting conditions, by
changing values defined in 0.xml. Figure 5.9 displays the three initial settings
of agents, varying x and y positions of agents.
Figure 5.10 represents the sugar distribution captured by citizens in the
simulation. The sugar distribution is shown in Figure 5.11 as frequency logs.
The results display a fairly egalitarian society where the wealth distribution is a smooth bell-shaped curve. Starting with a small number of rich and
poor agents, a broad middle class emerges, with a small distance between the
rich and the poor in the beginning. However with time, fewer citizen agents
emerge as the super rich and the middle class shrinks, increasing poor agents.
Initial conditions on locations also influenced wealth distribution, with citizen
105
(sugar_location_message->x-X)*(sugar_location_message->x-X) +
(sugar_location_message->y-Y)*(sugar_location_message->y-Y);
if(current_distance_squared <=
(citizen_view_length* citizen_view_length))
{
if(current_distance_squared
FLAG_SUGAR_FOUND=closest_sugar_id; //Agent memory saves this id
//"Sugar is found"
}
}
}
sugar_location_message=get_next_sugar_location_message
(sugar_location_message);
}
The next function can then use its memory values to determine if it needs
to interact with sugar agents in the iteration.
5.1.5 Handle Multiple ‘Eaten’ Requests
By recording the ID of the sugar agent closest to the citizen agent, the
citizen can then choose which sugar to interact with. When the sugar agents
then read these ‘request’ messages, they can choose one of the agents and be
‘eaten’ by one.
5.1.6 Change Starting Conditions
The experiment can be repeated with different starting conditions, by
changing values defined in 0.xml. Figure 5.9 displays the three initial settings
of agents, varying x and y positions of agents.
Figure 5.10 represents the sugar distribution captured by citizens in the
simulation. The sugar distribution is shown in Figure 5.11 as frequency logs.
The results display a fairly egalitarian society where the wealth distribution is a smooth bell-shaped curve. Starting with a small number of rich and
poor agents, a broad middle class emerges, with a small distance between the
rich and the poor in the beginning. However with time, fewer citizen agents
emerge as the super rich and the middle class shrinks, increasing poor agents.
Initial conditions on locations also influenced wealth distribution, with citizen
