SWR - cs.rpi.edu
Transcript of SWR - cs.rpi.edu
1
g � ��� � � � � � � � � � � � ���� � � � � �� � �� � � � � � � � � � � � ! " # � � $ � % & ' � ( � � � � � � &
)+*,*.- / 02143 / 5768579;:=<>6?<73 / 0;)@- A;5CB / 3 D4E8F�G
Sample Applications and Methodologies
Tom Kiehl ([email protected])
http://www.cs.rpi.edu/~kiehlt
g H I�J K L M K L N O P Q P R P N L S TVU�W P X P Y K M Z�P [ O\ ] ^ _ ` a b c d _ ] e f g h ] _ i _ j k l b m _ ` b c _ ` k
&U\SWR�*$
A CryptoQuote is a simple substitution code where each letter that appears may stand for a different letter.
The substitutions are consistent throughout the puzzle. Punctuation is not translated. For example: POLYYONTOP = RENSSELAER
So, how do we approach this?[encoding][fitness][selection][population][mutation][crossover]
g n o�p q r s q r t u v w v x v t r y z�{�| v } v ~ q s ��v � u� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
&U\SWR�*$��(QFRGLQJ
• 26 different possible letters => 26 Integer Alleles
• No two letters can convert to the same letter => 26 Unique allele values
• The allele positions tell us what each letter must convert to.
[encoding][fitness][selection][population][mutation][crossover]
g � ��� � � � � � � � � � � � � � � � �V �¡ � ¢ � £ � � ¤�� ¥ �¦ § ¨ © ª « ¬ ® © § ¯ ° ± ² § © ³ © ´ µ ¶ ¬ · © ª ¬ © ª µ
&U\SWR�*$��)LWQHVV
Many different approaches:
• Total Number of real words found in solution.– The GA had a tendency to solve the short words in the problem and leave larger
words untouched.
• For Each real word, calculate the percentage (lengthwise) of theentire string which this word represents. Sum all of the real words' percentages.
– This fitness function worked somewhat better the previous one, but still provided little pressure to attain large words
[encoding][fitness][selection][population][mutation][crossover]
g ¸ ¹�º » ¼ ½ » ¼ ¾ ¿ À Á À  À ¾ ¼ à Ä�Å�Æ À Ç À È » ½ É�À Ê ¿Ë Ì Í Î Ï Ð Ñ Ò Ó Î Ì Ô Õ Ö × Ì Î Ø Î Ù Ú Û Ñ Ü Î Ï Ñ Ò Î Ï Ú
&U\SWR�*$��)LWQHVV
Many different approaches:• A very complicated scheme in which each word in the solution
contributes to the overall fitness based on how connected the word is to other words. This measure also took into account whether or not the GA had solved some of the words that the word was connected to.
– We hard-coded some values for one particular problem and than ran just that one. It was obvious that the added value (almost nil) was not worth the programming
effort to make this work.
• Sum of the squares of the lengths of all of the real words.– Amazingly enough, this seems to work best, against all of our intuitions
about how much information we were providing the GA.
[encoding][fitness][selection][population][mutation][crossover]
g Ý Þ�ß à á â à á ã ä å æ å ç å ã á è éVê�ë å ì å í à â î�å ï äð ñ ò ó ô õ ö ÷ ø ó ñ ù ú û ü ñ ó ý ó þ ÿ � ö � ó ô ö ÷ ó ô ÿ
&U\SWR�*$��)LWQHVV
Many different approaches:
• Extra points for single letter words. This was used in conjunction with the sum of squares method.
– This accelerated the GA through some of the early stages of deciding what the single character words should be. Moved the population into a
state where most had a's and i's in place fo the single character words
[encoding][fitness][selection][population][mutation][crossover]
2
g � ��� � � � � � � � � � � � ���� � � � � �� � �� � � � � � � � � � � � ! " # � � $ � % & ' � ( � � � � � � &
&U\SWR�*$��)LWQHVV
The Dictionary’s Role:
• Tested with two different dictionaries– /usr/dict/words 25143 words
• contained individual letters
• contained abbreviations
• contained common names
• contained only root words (ed, s, ing, etc were missing)
– an NL dictionary 104217 words• addressed the above problems and provided more words
• Significantly better performance with NL dictionary
[encoding][fitness][selection][population][mutation][crossover]
g ) *�+ , - . , - / 0 1 2 1 3 1 / - 4 576�8 1 9 1 : , . ;�1 < 0= > ? @ A B C D E @ > F G H I > @ J @ K L M C N @ A C D @ A L
&U\SWR�*$��)LWQHVV
The Dictionary’s Role:
• word distributions
[encoding][fitness][selection][population][mutation][crossover]
g O P�Q R S T R S U V W X W Y W U S Z [�\�] W ^ W _ R T `�W a Vb c d e f g h i j e c k l m n c e o e p q r h s e f h i e f q
&U\SWR�*$��6HOHFWLRQ
Worked great even with a uniform random selection mechanism.
We found that this problem was just filled with localmaxima, so the random nature of the selection mechanism gave much better coverage of the search space.
[encoding][fitness][selection][population][mutation][crossover]
g t u�v w x y w x z { | } | ~ | z x � �7��� | � | � w y ��| � {� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
&U\SWR�*$��3RSXODWLRQ
• Size/Generations: – We ran with a large population size of 400, which was
necessary to maintain diversity. Much smaller when using speciation.
• Initialization: – Each individual had to adhere to the constraints of the
problem, having unique allele values.
– Later we seeded the initial population with individuals which already had solutions for large words. This gave us a significant boost in performance
[encoding][fitness][selection][population][mutation][crossover]
g � ��� � � � � � � ¡ ¢ ¡ £ ¡ � � ¤ ¥�¦�§ ¡ ¨ ¡ © � � ª�¡ « ¬ ® ¯ ° ± ² ³ ´ ¯ µ ¶ · ¸ ¯ ¹ ¯ º » ¼ ² ½ ¯ ° ² ³ ¯ ° »
&U\SWR�*$��0XWDWLRQ
• Swap Mutator– Had to maintain constraints
– Real simple, just caused a swap of values between two positions on the chromosome
[encoding][fitness][selection][population][mutation][crossover]
g ¾ ¿�À Á  à Á Â Ä Å Æ Ç Æ È Æ Ä Â É Ê7Ë�Ì Æ Í Æ Î Á à Ï�Æ Ð ÅÑ Ò Ó Ô Õ Ö × Ø Ù Ô Ò Ú Û Ü Ý Ò Ô Þ Ô ß à á × â Ô Õ × Ø Ô Õ à
&U\SWR�*$��&URVVRYHU
• Partial Match Crossover– Had to maintain constraints
[encoding][fitness][selection][population][mutation][crossover]
3
g � ��� � � � � � � � � � � � ���� � � � � �� � �� � � � � � � � � � � � ! " # � � $ � % & ' � ( � � � � � � &
&U\SWR�*$��9V��+LOO�&OLPELQJ
• Hill Climbing Observations– Most of the time the hill climbing methods couldn’t move
from one point to another in the space
– even if the hill climbing method got a “valid” answer, it wasn’t ever correct.
• GA Comparisons– GA maintained a set of valid individuals, final result
actually correct.
– Searched the space much more effectively
g ) *�+ , - . , - / 0 1 2 1 3 1 / - 4 576�8 1 9 1 : , . ;�1 < 0= > ? @ A B C D E @ > F G H I > @ J @ K L M C N @ A C D @ A L
&U\SWR�*$��5HVXOWV• Iuisbh supab wsxosib rt wsrwfs lar ens nbybunbuon fus. --EizirliGen #50 Fitness:109 Best:
** Biblty liwqt rlmclbt je rljrnl vqj xsl statistics nil. --Xbdbjvb Gen #100 Fitness:145 Best:
** Ninety eiwht leucent bv leblfe khb xse statistics fie. --Xndnbkn
Gen #150 Fitness:185 Best:
** Ninety eifht percent mq pempxe jhm zse statistics xie. --Znknmjn
Gen #200 Fitness:194 Best:
** Ninety eixvt percent wh pewple zvw qse statistics lie. --Qnbnwzn
Gen #250 Fitness:207 Best:
** Ninety eimxt percent of peopde vxo use statistics die. --Unznovn
Gen #300 Fitness:230 Best:
** Ninety eigft percent ov people qfo kse statistics lie. --Knhnoqn
Gen #350 Fitness:239 Best:
** Ninety eizut percent ok people quo vse statistics lie. --Vnbnoqn
Gen #400 Fitness:243 Best:
** Ninety eimzt percent oh people kzo use statistics lie. --Unxnokn
Gen #450 Fitness:255 Best:
** Ninety eight percent ob people zho fse statistics lie. --Fnmnozn
Gen #1100 Fitness:301 Best:
** Ninety eibht percent ox people who use statistics lie. --Unknown
Gen #1300 Fitness:326 Best:
** Ninety eight percent of people who use statistics lie. --Unknown
g O P�Q R S T R S U V W X W Y W U S Z [�\�] W ^ W _ R T `�W a Vb c d e f g h i j e c k l m n c e o e p q r h s e f h i e f q
&U\SWR�*$��5HVXOWV• Xul eohp bp kpwnlip O'b n iwulagvpe. Mfpvp nvpa'm paulzf iwulagvpei
oa xulv eoyp. -Fnvvoiua Yuvg, Mfp Pbcovp Imvohpi KnwhGen #50 Diversity:0.861545 Fitness:81 Convergence:1 Best:** Cob fkzs hs lsdibqs K’h i qdobrwesf. Muses iesr’m srobyu qdobrwesfq kr cobe fkgs. -Uieekqor Goew, Mus
Shakes Qmekzsq LidzGen #100 Diversity:0.813886 Fitness:102 Convergence:0.882353 Best:** Qkg rise de penagze I’d a znkguxmer. Theme ameu’t eukgbh znkguxmerz iu qkgm rive. -Hammizku Vkmx, The Edwime Ztmisez Pans Gen #150 Diversity:0.797175 Fitness:106 Convergence:1 Best:** Lam rots cs vszimks O’c i kzamxyesr. Buses iesx’b sxampu kzamxyesrk ox lame rows. -Uieeokax Waey, Bus Scqoes Kbeotsk ViztGen #200 Diversity:0.797005 Fitness:122 Convergence:0.92623 Best:** Qfg kipe me zeyagse I’m a syfgndrek. There aren’t enfglh syfgndreks in qfgr kibe. -Harrisfn Bfrd, The Emjire Stripes ZaypGen #300 Diversity:0.779562 Fitness:163 Convergence:1 Best:** Qfg kipe me zeyagse I’m a syfgndrek. There aren’t enfglh syfgndreks in qfgr kibe. -Harrisfn Bfrd, The Emjire Stripes ZaypGen #350 Diversity:0.808347 Fitness:163 Convergence:1 Best:
** Qfg kipe me zeyagse I’m a syfgndrek. There aren’t enfglh syfgndreks in qfgr kibe. -Harrisfn Bfrd, The Emjire Stripes Zayp
Gen #2550 Diversity:0.34339 Fitness:532 Convergence:1 Best:** You like me because I’m a scoundrel. Tgere aren’t enouzg scoundrels in your life. -
Garrison Ford, Tge Empire Strikes Back Gen #2600 Diversity:0.345111 Fitness:538 Convergence:1 Best:** You like me because I’m a scoundrel. There aren’t enough scoundrels in your life. -
Harrison Ford, The Empire Strikes Back
g t u�v w x y w x z { | } | ~ | z x � �7��� | � | � w y ��| � {� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
The End
g t u�v w x y w x z { | } | ~ | z x � ����� | � | � w y ��| � {� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• The Problem
• Representation
• Constraints: static/dynamic
• Operators
• Results
• Comparison w/ Linear Programming
g � ��� � � � � � � ¡ ¢ ¡ £ ¡ � � ¤ ¥7¦�§ ¡ ¨ ¡ © � � ª�¡ « ¬ ® ¯ ° ± ² ³ ´ ¯ µ ¶ · ¸ ¯ ¹ ¯ º » ¼ ² ½ ¯ ° ² ³ ¯ ° »
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Coverages
Sat.
City
Ins
tanc
e S
tart
End
Pri
orit
y1
Bei
jing
1
27
.01
55.
06
21
Bei
jing
2
15
7.86
186
.3
21
Bei
jing
3
28
9.76
311
.11
31
Bei
jing
4
87
8.41
893
.21
31
Bei
jing
5
99
9.66
102
7.08
21
Bei
jing
6
11
29.2
5 11
57.8
1 2
1
B
eijin
g 7
1263
.34
1289
.86
31
Bei
jing
8
13
97.6
6 14
24.5
6 2
1
B
omba
y 1
159
.56
173
.91
31
Bom
bay
2
2
87.4
6 3
14.5
5 2
1
B
omba
y 3
417
.51
445
.26
11
Bom
bay
4
5
55.9
1 5
59.9
6 2
1
B
omba
y 5
111
6.15
114
3.41
21
Bom
bay
6
1
246.
2 1
273.
75 2
1
B
omba
y 7
138
5.6
140
1.85
31
Bue
nosA
ires
1
95
.01
123
.75
31
Bue
nosA
ires
2
22
6.01
251
.86
21
Bue
nosA
ires
3
93
4.91
960
.91
21
Bue
nosA
ires
4
10
63.1
6 10
91.8
6 3
1B
ueno
sAir
es5
1197
.4 1
223.
05 3
1B
ueno
sAir
es6
1356
.76
1357
.93
31
Cal
cutta
1
2
8.31
40
.01
31
Cal
cutta
2
1
59.0
5 1
83.1
5 2
1
C
alcu
tta
3
288
.51
317
.25
21
Cal
cutta
4
4
20.8
44
3.61
21
Cal
cutta
5
9
93.5
10
14.6
5 2
1
C
alcu
tta
6
111
8.9
114
7.56
21
Cal
cutta
7
1
252.
16 1
277.
16 2
1
C
alcu
tta
8
139
4.61
140
7.4
3
4
g � ��� � � � � � � � � � � � ���� � � � � �� � �� � � � � � � � � � � � ! " # � � $ � % & ' � ( � � � � � � &
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
Task Types• Battery Offline : Executed when a battery must be put offline (1)
• Battery Recondition : Forces a full reconditioning of a battery. This event must be scheduled to occur on a somewhat periodic basis. Batteries require full reconditioning after spending a period of time being intermittently charged and discharged (2)
• Momentum Dump : A fairly short task which allows a satellite to maintain it’s orbit (3)
• Keep Station : this task is also related to the mechanics of maintaining orbit (3)
• Verify Link : This test the satellite’s ability to communicate with ground stations.(3)
• Calibrate : General maintenance (3)
• State of Health : send a measure of the satellite’s state to a ground station (4)
• Self Destruct: Burn up satellite in atmosphere
g ) *�+ , - . , - / 0 1 2 1 3 1 / - 4 576�8 1 9 1 : , . ;�1 < 0= > ? @ A B C D E @ > F G H I > @ J @ K L M C N @ A C D @ A L
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
Typical Task Setparam : Tasks : dur start_after finish_by :=
1 BatteryRecond 1 GS_Any 50 0 1440
1 Calibrate 1 GS_Any 0.34 0 1440
1 KeepStation 1 GS_Any 16 0 1440
1 StateOfHealth 1 GS_Any 10 0 720
1 StateOfHealth 2 GS_Any 10 360 1080
1 StateOfHealth 3 GS_Any 10 720 1440
g O P�Q R S T R S U V W X W Y W U S Z [�\�] W ^ W _ R T `�W a Vb c d e f g h i j e c k l m n c e o e p q r h s e f h i e f q
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
Type City Ground Station Eclipse I/w types 1,2,3 I/w type 41 Shrinks Shrinks No Interaction No Overlap No Interaction
2 Shrinks No Interaction No Overlap No Overlap No Interaction
3 No Interaction Within No Interaction No Overlap No Interaction
4 No Interaction Within No Interaction No Interaction No Overlap
Task Interactions
g t u�v w x y w x z { | } | ~ | z x � �7��� | � | � w y ��| � {� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Interaction of tasks with Eclipses
Task Duration Buffer
Unused TimeEclipse
Schedule of Eclipses for Satellite
Continuum of Valid Start Times for Task
T0 TN
Cn-xC0
g � ��� � � � � � � ¡ ¢ ¡ £ ¡ � � ¤ ¥�¦�§ ¡ ¨ ¡ © � � ª�¡ « ¬ ® ¯ ° ± ² ³ ´ ¯ µ ¶ · ¸ ¯ ¹ ¯ º » ¼ ² ½ ¯ ° ² ³ ¯ ° »
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Ground Station Tasks
GS 1GS 2
Tdur
Tdur Tdur
Tdur
Ground Stations Visible to a Single Satellite
Simstart Simend
Range of Valid Start Times for Task
Tdur
g ¾ ¿�À Á  à Á Â Ä Å Æ Ç Æ È Æ Ä Â É Ê7Ë�Ì Æ Í Æ Î Á à Ï�Æ Ð ÅÑ Ò Ó Ô Õ Ö × Ø Ù Ô Ò Ú Û Ü Ý Ò Ô Þ Ô ß à á × â Ô Õ × Ø Ô Õ à
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Crossover of Real Numbers
Relaxed Exploitation
ExplorationExploration
P1 P2
Exploitation
5
g � ��� � � � � � � � � � � � ���� � � � � �� � �� � � � � � � � � � � � ! " # � � $ � % & ' � ( � � � � � � &
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
P1_B
P2_BP1_A
P2_A
Assume that P1_A and P2_A are a large distance apart, while P1_B and P2_B are quite close to one another. Choosing a point between P1_A and P2_A might be viewed as being more exploratory and less as exploitation.Meanwhile, a point chosen between P1_B and P2_B could be viewed as a great amount of exploitation and very little exploration.
Assume that P1_A and P2_A are a large distance apart, while P1_B and P2_B are quite close to one another. Choosing a point between P1_A and P2_A might be viewed as being more exploratory and less as exploitation.Meanwhile, a point chosen between P1_B and P2_B could be viewed as a great amount of exploitation and very little exploration.
g ) *�+ , - . , - / 0 1 2 1 3 1 / - 4 576�8 1 9 1 : , . ;�1 < 0= > ? @ A B C D E @ > F G H I > @ J @ K L M C N @ A C D @ A L
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Parent Weighted Crossover
Exploration ExplorationExploitationExploitation Exploration
P1 P2
g O P�Q R S T R S U V W X W Y W U S Z [�\�] W ^ W _ R T `�W a Vb c d e f g h i j e c k l m n c e o e p q r h s e f h i e f q
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Crossover of Real Numbers
#5#40#7
5
#11
0
#14
5
#18
0
#21
5
#25
0
#28
5
67400
67600
67800
68000
68200
68400
68600
68800
69000
69200
69400
Fitness
Crossover Comparison
Parent Weighted
Uniform
BLX
g t u�v w x y w x z { | } | ~ | z x � �7��� | � | � w y ��| � {� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
6 7 0 0 0
6 7 5 0 0
6 8 0 0 0
6 8 5 0 0
6 9 0 0 0
6 9 5 0 0
F it n e s s
G e n e r a t io n
S e l e c t i o n M e t h o d
Un if or m
Roulet t e
Ran k
Tour n amen t
g � ��� � � � � � � ¡ ¢ ¡ £ ¡ � � ¤ ¥�¦�§ ¡ ¨ ¡ © � � ª�¡ « ¬ ® ¯ ° ± ² ³ ´ ¯ µ ¶ · ¸ ¯ ¹ ¯ º » ¼ ² ½ ¯ ° ² ³ ¯ ° »
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• Fitness Function
• Penalty Function
g ¾ ¿�À Á  à Á Â Ä Å Æ Ç Æ È Æ Ä Â É Ê7Ë�Ì Æ Í Æ Î Á à Ï�Æ Ð ÅÑ Ò Ó Ô Õ Ö × Ø Ù Ô Ò Ú Û Ü Ý Ò Ô Þ Ô ß à á × â Ô Õ × Ø Ô Õ à
*HQHWLF�$OJRULWKPV�IRU�
$XWRQRPRXV�6DWHOOLWH�&RQWURO
• The Problem
• Representation
• Constraints: static/dynamic
• Operators
• Results
• Comparison w/ Linear Programming
6
g � ��� � � � � � � � � � � � ���� � � � � �� � �� � � � � � � � � � � � ! " # � � $ � % & ' � ( � � � � � � &
&KHP�*$
• Explored Uncharted Chemical Space
• 8 Alleles positions– Four chemicals (of a particular set)
and their concentrations
• Fitness Function was a physical experiment. – A generation of 50 individuals took
two weeks
g ) *�+ , - . , - / 0 1 2 1 3 1 / - 4 576�8 1 9 1 : , . ;�1 < 0= > ? @ A B C D E @ > F G H I > @ J @ K L M C N @ A C D @ A L
6DWHOOLWH�*HQ����&LUFXLW�
$OORFDWLRQ
• Giant Decision Tree
• Determines the allocation of circuits for a satellite/city interaction
• Has been very difficult for the GA