CHAPTER 4 - SIMULATION DESIGN

4.1 Chapter Introduction

As mentioned previously, the design of the simulation was done concurrently with the agent architecture. Both were designed with each other in mind, using the characteristics of one other as guidelines.

A physical team game was selected as the subject of the simulation. A team game because one of the elements to be explored was the effects of other agents' emotions (both team-mates' and opponents') on one's own emotions. Therefore, multiple agents are required to implement this effect. A physical game would means that the agents would be reactive in nature as the game will be fast-moving. A deliberative agent could also mean more rules in the game and in the case a simple game with minimum rules is preferred to a complex game with lots of rules as once again the emphasis is on the study of emotions and not the game.

With a general idea of the game established, the detail rules of the game can now be specified.

4.2 Rules for Simplified Simulated Ball Game

The rules of the game are simple. Two teams with a number of players are put on a playing field. The size of the playing field and the number of players in each team is specified in the beginning of the simulation. The two team occupied different end of the field in the beginning of the game and the aim of the game is to get a ball to the scoring zone at the opposite end. That would be equivalent to scoring a goal. There are not out of play rules and no fouls. The team with the ball is labelled as the offensive team while the other team will be the defensive team. Figure 4.1 shows a diagram of a simulated playing field with six players per team specified.





Figure 4.1


4.3 Emotion Variables

With the rules of the games established, details of other elements in the simulation is necessary. A very important aspect of this simulation was to decide on which emotion variables to incorporate into the system. Although the simulation is capable of supporting any number of emotion variables, using all the emotion types as stated in the semantic-based theory would be unnecessary and unrealistic in the context of this project. It was important to scale down the number of emotion variables and to identify primary ones in my simulation.

After much brain-storming, it was the three pairs of emotion types are identified,

Basically, the three pairs of emotions reflect both ends of the spectrum, e.g. if the player has pride in his own team, he will not feel shame. Therefore, only three variables is necessary to represent each set. The emotion type in bold-italic (the positive aspect) will be referred to from here on and with represent the pair.

4.4 Player Actions

Before defining the reactive rules, we need to define the list of players actions available. These actions are the right hand side of the reactive rules. There are basically three sets of actions. Which set of actions do a team use depend on whether the team is on the offensive, defensive or none. These actions are the activities a player can carry out during a cycle of the simulation.

4.4.1 Possible Actions by Defensive Player

4.4.2 Possible Actions by Offensive Player

  1. Players without ball
    1. Get up - Recovered from a fallen position.
    2. Run - Run forward towards goal.
    3. Support - Run back towards player with ball.
    4. Nothing - Stay in current position.
  2. Player with Ball
    1. Get up - Recovered from a fallen position.
    2. Throw Mode - Throw ball to player in front.
    3. Run Mode - Run forward towards goal.
    4. Nothing - Stay in current position.

4.4.3 Possible Actions by when ball is free (Players are Neutral)

4.5 Reactive Rules

Details of the reactive rules can now be worked out with its associated emotion variables which could have an effect on its strength and its associated action. Associated emotions variables can be switched on or off for each rule. Following is the sets of defensive, offensive and neutral rules to be implemented.

4.5.1 Defensive Reactive Rules

The following table list out the possible rules for a defensive player with the emotion types which could affect its strength. A label (U) beside the emotion variable will indicate that what that emotion crosses the upper threshold, the strength of that rule will increase and when it violates the lower threshold, the strength of that rule will decrease. A label (D) will indicate inverse of the (U) relationship. These relationship can be changed in the parameter file.

Defensive Mode Emotions affecting Possibility of rule firing Rule
Tackle Joy (U), Pride (U), Appreciation (D) If opponent (with ball) distance = "near"

then tackle opponent

Chase Joy(D), Pride (U), Appreciation (D) If opponent (with ball) distance = "near" and

opponent (with ball) distance from goal < own distance

from goal

then chase opponent

Nothing Joy (D), Pride (D), Appreciation (D) If opponent (with ball) distance = "near" and

opponent (with ball) distance from goal > own distance

from goal

then do nothing.

Chase Joy (U), Pride (U), Appreciation (D) If opponent (with ball) distance > "near" and

opponent(with ball) distance <= "middle"

then chase opponent.

Retreat Joy (D), Pride (D) If opponent (with ball) distance > "near" and

opponent(with ball) distance <= "middle"

then retreat

Retreat Joy (D), Pride (D),

Appreciation (U)

If opponent (with ball) distance to goal < own distance to goal and

opponent (with ball) > "middle" and

opponent (with ball) distance from goal <= "middle"

then retreat toward player

Chase Joy (U), Pride (U),

Appreciation (D)

If opponent (with ball) distance to goal < own distance to goal and

opponent (with ball) > "middle" and

opponent (with ball) distance from goal <= "middle"

then retreat toward player

Chase   If opponent (with ball) > "far"

4.5.2 Offensive Reactive Rules

The following table list out the possible rules for a offensive player with the emotion types which could affect its strength. The representations (U) and (D) are the same as for the defensive rules.

Offensive Action Emotions affecting possibility of rule firing Rule
Run Pride (D), Appreciation (D) If player (with ball) distance from goal < own distance from goal and

player (with ball) distance from goal > "mid-near"

then run forward towards goal

Run Joy (D), Pride (D) If player (with ball) distance from goal < own distance from goal and

player (with ball) distance from goal <= "mid-near"

then run forward towards goal

Run Pride (U), Appreciation (D) If player (with ball) distance from goal > own distance from goal and

player (with ball) distance from goal > "mid-near"

then run forward towards goal.

Run Pride (U) If player (with ball) distance from goal > own distance from goal and

player (with ball) distance from goal <= "mid-near"

then run forward towards goal.

Nothing Joy (U), Pride (U) If player (with ball) distance from goal < own distance from goal and

player (with ball) distance from goal <= "mid-near"

then do nothing

Nothing Pride (U), Appreciation (U) If player (with ball) distance from goal < own distance from goal and

player (with ball) distance from goal > "mid-near"

then do nothing

Nothing Pride (D), Appreciation (U) If player (with ball) distance from goal > own distance from goal and

player (with ball) distance from goal > "mid-near"

then do nothing

Nothing Pride (D) If player (with ball) distance from goal > own distance from goal and

player (with ball) distance from goal <= "mid- near"

then do nothing

Throw Joy (D), Pride (U) If opponent distance <= "near" and

any own player <= "mid-far" and

own distance from goal <= "mid-near"

then throw ball to player

Throw Pride (U) If opponent distance <= "near" and

any own player <= "mid-far" and

own distance from goal > "mid-near"

then throw ball to player

Run Joy (U), Pride (D), Appreciation (D) If opponent distance <= "near" and

any own player <= "mid-far" and

own distance from goal < "mid-near"

then run towards goal

Run Pride (D), Appreciation (D) If opponent distance <= "near" and

any own player <= "mid-far" and

own distance from goal > "mid-near"

then run towards goal

Run   If opponent distance > near and

any own player > "mid-far"

then run towards goal

Run Joy (U), Pride (D) If opponent distance > "near" and

any own player <= mid-far"

then run towards goal

Throw Joy (D), Pride (U) If opponent distance > "near" and

any own player <= mid-far"

then throw ball to another player.

Support Pride (D) If player with ball >= "middle"

run back towards player with ball to support

Nothing Pride (U) If player with ball >= "middle"

run back towards player with ball to support

4.5.3 Neutral Reactive Rules

The following table list out the possible rules for a neutral player with the emotion types which could affect its strength. The representations (U) and (D) are the same as for the defensive rules.

Neutral Action Emotions affecting possibility of rule firing Rule
Stand up   If player is down

then get up

Get ball   If ball is free and ball = "near"

Get ball

4.6 Emotion Rules

The following table list out the possible emotion rules for success / failure of certain player's action, which will affect the emotion variables.

Emotions

Affected

Rule
Joy, Pride If throw is successful

then Joy of player increase, Joy and Pride of team-mates increases.

Joy, Pride If throw is unsuccessful

then Joy of player decreases, Joy and Pride of team-mates decreases.

Joy If tackle is successful

then increase Joy of tackler, Joy and Pride of team-mates increases.

Joy If tackle is unsuccessful

then decrease Joy of tackler, Joy and Pride of team-mates decreases.

Joy, Pride,

Appreciation

If goal is scored

then attacking team players Joy, Pride, Appreciation increases, defending team Joy, Pride, Appreciation decreases

Joy, Pride If get ball is successful

then Joy of player increase, Joy and Pride of team-mates increases.

Joy, Pride If get ball is unsuccessful

then Joy of player decreases, Joy and Pride of team-mates decreases.

Joy, Appreciation If Escape from tackle

then Joy, Appreciation increase

Joy, Appreciation If brought down by tackle from tackle

then Joy, Appreciation decrease

4.7 Flow of Simulation

The following diagram shows the flow of the simulation



No

Yes


Figure 4.1

The next chapter will focus on the actual implementation details which was based on the agent architecture and simulation design.

Copyright © 1995 to Hay Yong Joo