distributed genetic algorithms prof: paul schragger abdo achkar fall 2005 villanova university
TRANSCRIPT
Distributed Genetic Algorithms
Prof: Paul Schragger
Abdo Achkar
Fall 2005
Villanova University
Problem Definition
Distributed genetic algorithms to simulate the evolution of an animal.
General use case: Approximation problems that have no algorithmic
solution We might want to use [distributed] genetic
algorithms if The problem needs a lot of computation We want to avoid local minima/maxima
Genetic Algorithms
Program that optimizes a set of bit Strings that we name “Chromosome” according to a function that we call “fitness function”.
The bit Strings will Reproduce Be mutilated Be selected: the fittest will remain for the following
generation
Object Oriented Design
NetNodeHas-a
Population
Chromosome
ChromosomeLeg
Has-a
Has-a
Has-aIpList
Has-a
DatagramListener
Has-a
DatagramBroadcaster
Extends Thread
DgramListenerWorker
Has-a
Extends Thread
PacketHandler
Has-a
The Work Flow
BroadCast Anybody here
Wait for reply(DgramListener)
and
Solve Instance
Start
PacketHandlerReceived Packets
Associated event with the packet
Note: this event can be a broadcast or a new listen
DgramListenerWorker
MsgParser
Inside the DgramPacketHandler
private void doCommand(int command,DatagramPacket p) { switch(command) { case MsgClass.WAIT_FOR_DATA:
… case MsgClass.MSG_ANYBODY_HERE:
… case MsgClass.MSG_SERVER_CONNECT_TIMEOUT:
… case MsgClass.MSG_SERVER_IS_DOWN:
… case MsgClass.MSG_YOU_ARE_THE_SERVER:
…}
}
The Voting Algorithm
Wait for Server’s Data
event
Client detects server’s time out
Broadcasts the server failed Listen for votes
Vote Received
Add to IP list
Msg:vote
Vote Wait for votesresult
1
2
3 3
4
5
5
End of Vote
Send “you are the server” To the highest IP
6
7
Act Accordingly
8
The Program FlowAnybody here
Listen
Data Received
Timeout
We are Clients
ListenData Received
Timeout
Broadcast: vote
Update Population
Vote call received
Listen
Vote
We are servers
Msg:You are the server
BroadcastWe are server
Listen
Add IP to list
Vote Received
Timeout
Tell the server
We Serve
Listen
Anybody here
Send Data
Vote call received
Data Received
References Artificial Intelligence, Negnevitsky. Distributed Computing, Attiya and Welch Distributed Application Programming in C++,
Maddox The Essential Guide to Networking, Keogh Network Management, Subramanian Java How to Program, Deitel and Deitel Distributed Systems, Tanenbaum and Van Steen C++ In Action, Melweski Inertie d’un système, M Devel, Université de
Franche-Comté