Senior Design 2nd Semester Update

Chris Klumph and Kody Willman
Spring 2008
Resource Allocation in a MMOG
 in a massive multiplayer online game (MMOG) multiple
players are simultaneously connected to a virtual game
world at any given time
 this heterogeneous system has
 varying computer capabilities (e.g. processor, memory, etc.)
 varying communication times between players’ computers
1
Problem Statement
Pn
P2
Main
Server
(MS)
P3
…
P1
all players connected directly
to main server (MS)
vs.
players connected to MS
directly or through secondary
server (SS)
Pn-1
P6
P5
Pn
P4
Pn-1
SS
P2 2
Main
Server
(MS)
P3
SS
P66
…
P1
P5
P4
2
Terminology and Goals of Project
Terminology
 RTmax
 maximum response time between
players’ computers and MS
 heuristic
 way to allocate resources (servers)
 problem analogous to mapping
tasks to machines (NP complete)
 chromosome
 represents a mapping of players and
servers (who’s connected to whom)
Goals
 given that 200 players are connected
directly to the MS
 reconnect players to either MS or SS
to minimize RTmax
 use multiple heuristics to find valid
mappings
 must determine three things:
 number of SSs
 who becomes an SS
 what players connect to those SSs
3
Chromosome Example
MS
SS (P6)
players 1 and 3 are
connected to SS (P2)
SS (P2)
players 4 and 5 are
connected directly to MS
P4
P1
P8
P5
players 7 and 8 are
connected to SS (P6)
P7
P3
Player Assignments
P1
P2
P3
P4
P5
P6
P7
P8
P2
SS
P2
MS
MS
SS
P6
P6
4
Genitor Overview
genitor_heuristic()
{
generate_initial_population;
ranking;
while(stopping criteria not met)
{
selection;
crossover;
mutation;
ranking;
}
output best solution found;
}
 selection: selects 2 random parents




using roulette wheel selection
crossover: picks 2 random points
within parents and swaps all data
elements within those points
between parents to create offspring
mutation: randomly mutates
elements within offspring with
predetermined probability
ranking: evaluates new chromosomes
based on RTmax and sorts them into
ranked list
stopping criteria: 10,000 iterations
with no change in the (current) best
solution or 10 minutes
5
Changes in Genitor
 objective function
 old: RTmax = 2 x Comm(Px, SSy) + Comp(SSy) + 2 x Comm(SSy, MS)
+ Comp(MS)
 new: RTmax = Comm(Px, SSy) + Comp(SSy) + Comm(SSy, MS) +
2∙Comp(MS) + Comm(MS, SSy) + Comm(SSy, Px)
 crossover fixing
 old: invalid mappings randomly assigned to new SSs
 new: invalid mappings assigned to achieve lowest RTmax
6
K-Optimized Dual Iterative Minimization
KODI
 200 users
 k initial SS created
 for 10-30 iterations
 run Phase 1
 run Phase 2
 compare RTmax times at
each Phase
 output best solution
7
Formulas
RTmax
 Px : player x
 SSa: secondary server a
 RTmax = Comm(Px, SSa) + Comp(SSa) + Comm(SSa, MS) + 2∙Comp(MS)
+ Comm(MS, SSa) + Comm(SSa, Px)
 DCU: directly connected user
Pct
 Px : player x
 S: server (can be SS or MS)
 Pct (player connection time) = Comm(Px , S) + Comm(S, Px)
8
Min-Min RT
1. given a predetermined set of DCU’s, all players that are
2.
3.
4.
5.
not in the set of DCU’s are marked as unassigned
for each unassigned player, the server (MS or DCU) that
gives the minimum RT is determined
the pair, <player, server> with the smallest RT among
those generated in step 2 is selected
the player in the best pair selected from step 3 is then
assigned to the corresponding server
steps 2 through 4 repeated until all players assigned
9
DCU Min-Min
1. given a predetermined set of DCU’s, all players that are
2.
3.
4.
5.
not in the set of DCU’s are marked as unassigned
for each unassigned player, the server (DCU only) that
provides the minimum RT is determined
the pair, <players, server> with the smallest RT among
all generated in step 2 is selected
the player in the best pair selected is then assigned to
the corresponding server
steps 2 through 4 repeated until all players assigned
10
Phase 1

1.
2.
3.
4.
5.
iteratively adjusts the number of DCUs to minimize RTmax
randomly pick k, between 1 and 200, for initial DCUs
randomly assign k players as DCU
finish assignment of 200-k players using DCU Min-Min
find player with RTmax and if
1. player: unmap, and remap using Min-Min RT
2. DCU: (no players connected) unmap, and remap using
Min-Min RT
repeat 5 for 1000 iterations or no improvement
11
Phase 2

1.
2.
3.
4.
iteratively adjusts the connection times of players to minimize
the RTmax
find player that has the largest connection time Pct
for that Pct player if it is
1. DCU: unmap it, and all players connected through it, and
remap using Min-Min RT
2. player: unmap, and remap using Min-Min RT
check if new mapping results in lower RTmax time otherwise
keep previous
repeat steps 2 and 3 for 1000 iterations or no improvement is
found in the solution
12
Results from 1st Semester
• learned about frequently-used heuristics
• implemented, debugged, and simulated the following:
• genetic algorithm
• genitor
• kodi (k-optimized dual iterative) minimization
• obtained results from all heuristics, focused on genitor and kodi
minimization
• part 1 of project does not consider robustness
13
Goals for 2nd Semester
• changes in simulation model
• objective function
• asymmetric communication times
• other heuristics must be adapted to RTmax changes
• tabu search
• dual-iterative minimization
• discrete particle swarm optimization
• adapt heuristics to part 2 of project by introducing robustness
14