Agents in Economic Markets and Games
127
• Post message of good’s price.
• Post message of stock left in shop. Stock is by default started from
100.
Function - Customer types (A-E) 1:
• Calculate and set random
wage.
Function - CustA 2:
• Calculate a random shop.
• Check if it has savings, buy goods from the shop.
• Post out new stock of the shop.
• Set new satisfied value if more than 0.5, post out message of satisfaction of the shop bought from.
Function - CustB 2:
• Check the satisfying value (past) of this customer. If more that 0.5, then the customer will buy from the past
shop. Else calculate a shop on random and buy from that shop.
• Checks if savings exist, buy goods from the shop.
• Post out new stock of the shop.
• Set new satisfied value, if more than 0.5, post out message of satisfaction of shop bought from.
Function - CustC 2:
• Check the posted satisfied messages, get the first
message and choose to go to that shop.
• Check if savings, buy goods from the shop.
• Post out new stock of the shop.
• Set new satisfied value if more than 0.5, post out message of satisfaction of this shop bought from.
Function - CustD 2:
• Choose a shop randomly.
• Check if shop has stock. If it does, then shoplift.
• Post out new stock of the shop.
Function - CustE 2:
• Choose 5 shops at random.
• Sort the shop list in order of cheapest.
• Check if savings, buy goods from the shop on top (cheapest shop).
• Post out new stock of the shop.
• Set new satisfied value if more than 0.5, post out message of satisfaction of this shop bought from.
Function - Shop 3:
• Find the latest stock message of shop agent and
calculate how much stock was sold in this iteration.
• According to the stock sold and price, calculate income shop collected.
Précédent

- 156/329

Suivant