Title: From A-Life Agents to a Kingdom of N Queens IAT
1From A-Life Agents to a Kingdom of N
QueensIAT99 Nominated to Best paper award
- Han Jing
- University of Science Technology of China
- Jiming Liu
- Hong Kong Baptist University
- Cai Qingsheng
- University of Science Technology of China
2Outline of this talk
- 1.Introduction
- 2.The Basic A-Life Idea for Solving N-Queen
Problem - 3.The A-Life Agent Model for N-Queen Problem
- 4.Experimentation
- 5.Discussion and Conclusion
- 6.Future Work
31. Introduction
- Model from the nature Living environment
Individual agent Interacting rules - Domain Constraint Satisfaction Problems(CSPs)An
Example N-Queen Problem(NQP) a newly explored
area of research - Goal
Environment Distributed agents Reactive rules
? Intelligence
41. Introduction What is a CSPs solver?
Given
- Variable set XX1,X2,,Xn
- Domain set DD1,D2,,Dn (Xi?Di )
- Constraint set RC1,C2,,Cm
An solution Assignment of values satisfying
all constraints
5An Example N-Queen Problem(NQP)
- X n indistinguishable queens
- D an NN chessboard
- R no collisions no two queens placed on
- the same row
- the same column
- or the same diagonal
- An NP hard problem
62.The Basic A-Life Idea for Solving NQP
Environment Distributed agents Reactive rules
? Intelligence
Naïve Construction
- Chessboard ? Environment
- Queen ? Agent
- Constraint ? Agents moving strategy (move to a
non-collision position)
Nothing but the traditional search!!!
72.The Basic A-Life Idea for Solving NQP
Survival of the Fittest High-fitness agent ?
Gain energy ? Survival (form a solution)
Low-fitness agent ? Punished, lose energy ? Die
Environment Distributed agents Reactive rules
? Emergent intelligence
The New Construction
Easy to find a position! MOVE ?SELECTION
- Environment Chessboard dynamic, recording the
number of current collisions. - Agent Queen energy, easy moving strategies
(random move, move to the least collision
position) - ModelSurvival of the Fittest (energy
loss,eat,die) - Potential power to find a solution avoid losing
energy
83.The A-Life Agent Model for NQP
Agent
Collision number
- Initial Energy agi.energye0
- Moveright/left
- Lose energy (?energy)
- each move (?energy1 unit)
- move to a lattice with collision number m
(?energym units) - Dieenergyltthreshold (suppose to be zero)
- Eatag1 meets ag2
- if ag1. energy-ag2.energy gt Merge Threshold
- then ag2 die, ag1 get ag2.energy
- Moving strategies (different probability)
- Random-move
- Least-move least collision number lattice
- Coop-move cooperating with some agents
9
E10
die
eat
8
7
3
4
least-move
93.The A-Life Agent Model for NQPSystem Algorithm
Initialization
Yes
No
Dispatch agents
Is a Solution ?
Yes
After some low-fitness agent died, the
systemwill be more efficient.
Output
Wanted AnotherSolution ?
10Environment
- NN square lattice. Each lattice records
1.what agents are on it? 2.the number of
collisions
8
6
4
10
2 circles means 2 agents
4
8
10
11
9
12
5
6
9 agents conflict this positionDeeper blue color
means more collisions there
9
6
9
9
11A Snapshot of the System
- Initialization
- Initial agents energy, different strategy
parameters - M agents/row (mgt1)
- Randomly placed
Prandom-move 0.5 Pleast-move 0.4 Pcoop-move 0.1
Lattice Deeper color means larger collision
number
gt
Prandom-move 0.05 Pleast-move 0.8 Pcoop-move
0.15
T0
12A Snapshot of the System
Operation At each time step dispatch each
agent Reaction lose energy, die, eat
13A Snapshot of the System
Pervious solution
T9
144.Experimentation - An case study
- 1500-queen (limited by the memory) CPU P233,
RAM32M, OS Win95.
Runtime(s)
N of Queens
154.Experimentation
? Observation Chaos in the system
Exp1 Prandom-move0.01, Exp2 Prandom-move0.02
Prandom-move is high ? efficiency
decreases Prandom-move0 ? system falls into a
local optimum
16? Observation1survival of the fittest
4.Experimentation
Exp1N(20,410),RowNum1,RunNum1,MaxRandom-p1,
MaxLeast-P90, MaxCoop-P20 Exp2N(20,410),RowNum
2,RunNum2,MaxRandom-p1, MaxLeast-P90,
MaxCoop-P20 Exp3N(20,410),RowNum3,RunNum3,
MaxRandom-p1, MaxLeast-P90,MaxCoop-P20
More agents ? More choice !!!
Bad agent ? punish ? die ?system efficiency
increase!
174.Experimentation
? ObservationPLeast-move vs. PCoop-move
PLeast-move is more important than PCoop-move
185.Discussion and Conclusion
Environment Distributed agents Reactive rules
? Intelligence
- Better than Network GA
- Distributed and no centralized control
- Agent selection Survival of the Fittest
A-Life1500-queen (several hundred seconds)
(Traditional search 96-queen)Hopfield/
Minimum Network 100-queen GA 200-queen
19Lets see the demo --Readme of the demo
- For example, if you like to see how use 3
agents/row to solve 40-queen problem - 1.click Settings in the main menu
- 2.write 40 in the Queen Num item, write 3 in the
AgentNum/Row item - 3.click OK of the dialogue box
- 4.click Newgame-gtRandom in the main menu
- 5.click Resume in the main menu to see the
running of the system, if you want to pause it, - you can click Pause
- Or click Step in the main menu if you want to
watch how it runs carefully - 6.when it find a solution, a message box will pop
up, click on it - 7.Another message box pop up, click on it, then
the system will randomly place the survival - agents and continue to find another solution.
- Goto 5.
20Run it by clicking here!
216.Future Work
- Solve an (Nm)-Queen Problem based on solving an
N-Queen Problem - Introduce reproduction and mutation
- Utilize the A-Life model to solve other CSPs
Thank You!
- CSPsX(variable),D(domain),R(constraint)
A-Life System. - X Agent (m agents represent one variable,
mgt1) - D R Environment Rules
- Solution Positions of the current survival
agents
22This PowerPoint file and demo www.comp.hkbu.edu.hk
/hanjing/nq.html