The selection module runs the genetic algorithm to figure out the ‘best’ action for each run; actions are typically
‘move forward/left/right’ or just ‘rotate by some angle’. The fitness function depends on the length of the longest,
unimpeded line of sight (as calculated by the ray-casting functions in LSL) and the nearness of the current goal
(which we will see shortly), as well as some additional weighting coming from the two last modules. Certain objects
in the virtual world environment also act as goals or attractors (in the sense of swarm attractors) and they flag their
position to this module, which uses them to calculate and order rules according to a GA. Currently, a classical GA is
being implemented, but other non-classical algorithms might also be employed to compare results.
The behaviour module, once a rule has found by the GA, will flag RESTbot to move the avatar around, if a
movement is the best choice encoded by the rule, or another behaviour might be triggered. In terms of
SL/OpenSimulator, this mostly means playing a gesture or animation (for example, if the NPC waves or greets
another NPC or human) or eventually sitting down on some object (which will be explained in a later section).
With the core modules, NPCs are able to navigate in an environment of which they are only partially aware, and
deal with collisions and simple interactions (avoiding other NPCs, for example, like in swarms). Notice that, due to
the constant dynamic changes of the environment, is was considered wasteful to implement a ‘memory’ of past
interactions or movement sequences.
6. Borrowing ideas from games
This project follows the methodology of Design Science [46,47] — the search for an artefact that fulfils
specifications — in our case, to allow historians and archaeologists to create crowd simulations based on intelligent
agents without the need to programme anything in traditional computer code.
While the section above permits movement and collision management without any additional rules, goals and
interactions are not contemplated. The next module deals with motivation, and it works together with the selection
module to feed the GA with appropriate weighting for the rule selection.
Here we consider the following analogy, typical of strategy simulation games: Each NPC is assigned a certain
energy level. As they move around, they lose energy, and, at some point, they will have to change their strategy or
goal in order to search for a way to recharge their energy. This is very similar to the approach used in robotics,
where robots will also track the energy level of their batteries and need to move to a recharge station periodically
[32], and virtual simulations of robots, where similar concepts are employed [48,49]. Both approaches use GA to
‘train’ robots, and the expected emergent behaviour was observed: robots, real and virtual, will maximize their ‘life’
by appropriately returning to the recharge stations as their energy levels drop.
To simulate the motivation of going to work every day, we define a goal for earning money. These are special
places in the environment where the NPC is able to increase its money level until it reaches a certain threshold (the
‘daily wage’) and loses some energy in the process, after which it will return ‘home’ for an energy recharge. This is
done by having historians visually dropping special cubes on the ground — yellow for energy, green for money —
and assign a NPC to them. The energy/money boxes include a simple slider, which allow them to define the rate of
energy replenishment or amount of money earned, which can be adjusted dynamically— both the position, and the
rate. Every time the cubes are changed, the motivation module is flagged, changes the appropriate information on the
database (location and rate), and the GA on the selection module will re-calculate the fitness for its rules.
Historians can also model a behaviour where NPCs stay for some time at work, while energy gets depleted, but
instead of returning home for a full recharge, they can go to the nearest tavern or market stall for refreshment. To
allow for this behaviour, a special home box was added, which is the ‘main’ goal for a NPC to return to, but, while
at work, if energy levels are not enough, NPCs might be able to search for nearby yellow energy cubes for a quick
recharge. It is expected that this allows NPCs to walk longer paths while ‘eating’ on their way to and from work.
How to deal with the special events — leaving work and/or home to attend a processional, for instance? A
possible approach is to add a fourth cube for happiness. While at work, NPCs earn money and lose some energy, but
their happiness levels drop even quicker. To recover happiness, historians can drop red cubes inside of churches or
other entertainment areas. Thus, it is expected that NPCs will sometimes feel ‘bored’ at work, leave their place (even
if their ‘daily wage’ is not fully earned yet!) and wander around in search of some entertainment — while losing
energy that way, and, perhaps, they might select a goal to get some quick energy at a tavern before returning to
work. Or they might ‘stray’ away from the workplace so much that the GA selects the ‘home’ goal instead.
The selection module runs the genetic algorithm to figure out the ‘best’ action for each run; actions are typically
‘move forward/left/right’ or just ‘rotate by some angle’. The fitness function depends on the length of the longest,
unimpeded line of sight (as calculated by the ray-casting functions in LSL) and the nearness of the current goal
(which we will see shortly), as well as some additional weighting coming from the two last modules. Certain objects
in the virtual world environment also act as goals or attractors (in the sense of swarm attractors) and they flag their
position to this module, which uses them to calculate and order rules according to a GA. Currently, a classical GA is
being implemented, but other non-classical algorithms might also be employed to compare results.
The behaviour module, once a rule has found by the GA, will flag RESTbot to move the avatar around, if a
movement is the best choice encoded by the rule, or another behaviour might be triggered. In terms of
SL/OpenSimulator, this mostly means playing a gesture or animation (for example, if the NPC waves or greets
another NPC or human) or eventually sitting down on some object (which will be explained in a later section).
With the core modules, NPCs are able to navigate in an environment of which they are only partially aware, and
deal with collisions and simple interactions (avoiding other NPCs, for example, like in swarms). Notice that, due to
the constant dynamic changes of the environment, is was considered wasteful to implement a ‘memory’ of past
interactions or movement sequences.
6. Borrowing ideas from games
This project follows the methodology of Design Science [46,47] — the search for an artefact that fulfils
specifications — in our case, to allow historians and archaeologists to create crowd simulations based on intelligent
agents without the need to programme anything in traditional computer code.
While the section above permits movement and collision management without any additional rules, goals and
interactions are not contemplated. The next module deals with motivation, and it works together with the selection
module to feed the GA with appropriate weighting for the rule selection.
Here we consider the following analogy, typical of strategy simulation games: Each NPC is assigned a certain
energy level. As they move around, they lose energy, and, at some point, they will have to change their strategy or
goal in order to search for a way to recharge their energy. This is very similar to the approach used in robotics,
where robots will also track the energy level of their batteries and need to move to a recharge station periodically
[32], and virtual simulations of robots, where similar concepts are employed [48,49]. Both approaches use GA to
‘train’ robots, and the expected emergent behaviour was observed: robots, real and virtual, will maximize their ‘life’
by appropriately returning to the recharge stations as their energy levels drop.
To simulate the motivation of going to work every day, we define a goal for earning money. These are special
places in the environment where the NPC is able to increase its money level until it reaches a certain threshold (the
‘daily wage’) and loses some energy in the process, after which it will return ‘home’ for an energy recharge. This is
done by having historians visually dropping special cubes on the ground — yellow for energy, green for money —
and assign a NPC to them. The energy/money boxes include a simple slider, which allow them to define the rate of
energy replenishment or amount of money earned, which can be adjusted dynamically— both the position, and the
rate. Every time the cubes are changed, the motivation module is flagged, changes the appropriate information on the
database (location and rate), and the GA on the selection module will re-calculate the fitness for its rules.
Historians can also model a behaviour where NPCs stay for some time at work, while energy gets depleted, but
instead of returning home for a full recharge, they can go to the nearest tavern or market stall for refreshment. To
allow for this behaviour, a special home box was added, which is the ‘main’ goal for a NPC to return to, but, while
at work, if energy levels are not enough, NPCs might be able to search for nearby yellow energy cubes for a quick
recharge. It is expected that this allows NPCs to walk longer paths while ‘eating’ on their way to and from work.
How to deal with the special events — leaving work and/or home to attend a processional, for instance? A
possible approach is to add a fourth cube for happiness. While at work, NPCs earn money and lose some energy, but
their happiness levels drop even quicker. To recover happiness, historians can drop red cubes inside of churches or
other entertainment areas. Thus, it is expected that NPCs will sometimes feel ‘bored’ at work, leave their place (even
if their ‘daily wage’ is not fully earned yet!) and wander around in search of some entertainment — while losing
energy that way, and, perhaps, they might select a goal to get some quick energy at a tavern before returning to
work. Or they might ‘stray’ away from the workplace so much that the GA selects the ‘home’ goal instead.
การแปล กรุณารอสักครู่..
