-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPearlHunter.html
More file actions
659 lines (596 loc) · 27.9 KB
/
Copy pathPearlHunter.html
File metadata and controls
659 lines (596 loc) · 27.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_21) on Tue Jun 14 15:58:42 CST 2011 -->
<TITLE>
PearlHunter
</TITLE>
<META NAME="date" CONTENT="2011-06-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="PearlHunter";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?PearlHunter.html" target="_top"><B>FRAMES</B></A>
<A HREF="PearlHunter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class PearlHunter</H2>
<PRE>
java.lang.Object
<IMG SRC="./resources/inherit.gif" ALT="extended by ">AbstractClasses.HyperHeuristic
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>PearlHunter</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>PearlHunter</B><DT>extends AbstractClasses.HyperHeuristic</DL>
</PRE>
<P>
This class is the Pearl Hunter prepared for <a href="http://www.asap.cs.nott.ac.uk/chesc2011/">CHeSC 2011</a>
(Cross-Domain Heuristic Search Challenge 2011) by Fan Xue (dewolf_matri_x@msn.com) at Hong Kong Polytechnic University.
Pearl Hunter is implemented on the HyFlex platform provided by the organizer (See <a href="http://www.asap.cs.nott.ac.uk/chesc2011/hyflex_tutorial.html">http://www.asap.cs.nott.ac.uk/chesc2011/hyflex_tutorial.html</a>).
<p>
Pearl Hunter is an iterated
local search (ILS). Hunter considers LOCAL_SEARCH procedures as actions of "<strong>dive</strong>" and CROSSOVER,
MUTATION, RUIN-RECREATE heurisitcs as actions of "<strong>move</strong>." So a typical ILS search is no more than an action sequence
"<strong>move</strong>-<strong>dive</strong>-<strong>move</strong>-<strong>dive</strong>" for Hunter. A typical run
can be found in the <a href="#solve(AbstractClasses.ProblemDomain)"><code>solve()</code></a> function.
<p>
<h3>Features:</h3>
<p>
Differs from common ILS, Pearl Hunter has two types of local search. One is Snorkeling() in "returns if any
improvement" style, another is DeepDive() (scuba?) in "returns if no improvements can be further found" style. Usually
Hunter tries a number of Snorkeling() before selecting one to DeepDive() in a typical <strong>dive</strong> action.
In the DeepDive() function, an ordered list of <strong>dive</strong> candidates "ABCD" is repeatedly excuted in two (approximate) parallel "ABACBADCBA" + "DCBACBABAA"
sequences until no improvement found. Because of the inconsistencies of <strong>dive</strong> moves, such a DeepDive() with a proportion of redundant local search
usually returns better results. The Snorkeling() function's test sequence is "ABACADA" and returns if any improvement is found.
However, there are two kinds of exceptions for <strong>dive</strong>s.
In some cases, a single "A" action may cost a lot of time (e.g., 3% of overall time). Once such time-consuming local search is detected,
a "sea trench" flag is marked. The parameter (DepthOfSearch) in the DeepDive() is reduced to 1/5, and the parallel sequences
are replaced by "ABACADA" (same as the Snorkeling()'s).
In some other (rare) cases, a "shallow water" flag is marked when "A" and "D" have done hundreds of improvements and "B" and "C" have none.
In "shallow water," the sequences of Snorkeling() and DeepDive() are simplified to "AB" and "A" + "BA" + "CA" + "DA" (minimal in four parallel) respectively.
<p>
Pearl Hunter also enables a combination of <strong>move</strong>s before a <strong>dive</strong>, which is uncommon in ILS. That means "<strong>move</strong>-<strong>move</strong>2-<strong>dive</strong>" or "<strong>move</strong>-<strong>move</strong>2-<strong>move</strong>3-<strong>dive</strong>" is also eligible.
In order to get rid of the starting position too far away from known ones, Hunter sets a "buoy" in the level (obj Value)
of first <strong>dive</strong>. if the position of the first <strong>move</strong> does not exceed the "buoy,"
Hunter could accept another <strong>move2</strong> before <strong>dive</strong>. In other words, if trapped
in a "local optimum", Hunter will consider more diversifications before intensification. This feature is enabled
in <a href="#CO_BUOY_MODE">CO_BUOY_MODE</a>, <a href="#AVG_TEST_MODE">AVG_TEST_MODE</a>, and <a href="#AVG_BUOY_MODE">AVG_BUOY_MODE</a>.
<p>
Pearl Hunter is a clever program. Hunter usually spends first 20% of all job time to test instructed "<strong>dive</strong>s" and "<strong>move</strong>s,"
CROSSOVER <strong>move</strong>s (because of two solutions orientation) followed by <strong>dive</strong>s in the first half and MUTATION + RUIN-RECREATE <strong>move</strong> in the
later half. Hunter makes a decision after that to choose a running mode from <a href="#CO_ONLY_MODE">CO_ONLY_MODE</a>, <a href="#CO_BUOY_MODE">CO_BUOY_MODE</a>, and <a href="#AVG_BUOY_MODE">AVG_BUOY_MODE</a>.
<p>
Pearl Hunter also restricts the number of low level <strong>move</strong>s. For example, if
there are 15 MUTATION <strong>move</strong>s, Hunter will test them quickly and choose 4 <strong>move</strong>s to practice later.
<p>
Other mechanisms, such as hashed memory (cache) of history of <strong>dive</strong> (also used as an unwanted - iferior to tabu - list), temporary tabu list in the <strong>move</strong>s around the buoy (such as
"<strong>move</strong>2" and "<strong>move</strong>3"), records of best-so-far (pool), mission restart (restart if no new solutions are found for x% of overall time), etc, can be found in detail in the codes.
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="PearlHunter.html#solve(AbstractClasses.ProblemDomain)"><CODE>solve(AbstractClasses.ProblemDomain)</CODE></A></DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#ATT_TEST">ATT_TEST</A></B></CODE>
<BR>
flag of generating attributes of low level heuristics.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#AUTO_MODE">AUTO_MODE</A></B></CODE>
<BR>
default running mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#AVG_BUOY_MODE">AVG_BUOY_MODE</A></B></CODE>
<BR>
a standard running mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#AVG_TEST_MODE">AVG_TEST_MODE</A></B></CODE>
<BR>
a test mode, usually appears in the second 10% of total time.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#CO_BUOY_MODE">CO_BUOY_MODE</A></B></CODE>
<BR>
a standard running mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#CO_ONLY_MODE">CO_ONLY_MODE</A></B></CODE>
<BR>
a standard running mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#CO_TEST_MODE">CO_TEST_MODE</A></B></CODE>
<BR>
a test mode, usually appears in the first 10% of the time horizon.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#heuristicsAttributes">heuristicsAttributes</A></B></CODE>
<BR>
returns an attribute matrix of low level heuristic candidates.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#MOD_TEST">MOD_TEST</A></B></CODE>
<BR>
flag of generating attributes of modes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#modeAttributes">modeAttributes</A></B></CODE>
<BR>
returns an attribute matrix of standard modes <br>(CO_ONLY_MODE, CO_BUOY_MODE, AVG_BUOY_MODE).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#modeToPersist">modeToPersist</A></B></CODE>
<BR>
mode to persist to run.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#SEA_TRENCH_MODE">SEA_TRENCH_MODE</A></B></CODE>
<BR>
a standard running mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#TRACELEVEL">TRACELEVEL</A></B></CODE>
<BR>
trace level.</TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_AbstractClasses.HyperHeuristic"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class AbstractClasses.HyperHeuristic</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>rng</CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="PearlHunter.html#PearlHunter(long)">PearlHunter</A></B>(long seed)</CODE>
<BR>
Constructs a new Pearl Hunter with a random seed</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#solve(AbstractClasses.ProblemDomain)">solve</A></B>(AbstractClasses.ProblemDomain problem)</CODE>
<BR>
This method defines the strategy of the hyper-heuristic.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="PearlHunter.html#toString()">toString</A></B>()</CODE>
<BR>
this method provides a name</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_AbstractClasses.HyperHeuristic"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class AbstractClasses.HyperHeuristic</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>getBestSolutionValue, getElapsedTime, getFitnessTrace, getTimeLimit, hasTimeExpired, loadProblemDomain, run, setTimeLimit</CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="TRACELEVEL"><!-- --></A><H3>
TRACELEVEL</H3>
<PRE>
public static int <B>TRACELEVEL</B></PRE>
<DL>
<DD>trace level. <br>Possible values: <br><strong>0</strong> - silent(default), <br>1 - messages, <br>2 - verbose
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="AUTO_MODE"><!-- --></A><H3>
AUTO_MODE</H3>
<PRE>
public static final int <B>AUTO_MODE</B></PRE>
<DL>
<DD>default running mode. <br>The program will test CROSSOVER heuristics in CO_TEST_MODE in the first 10% time, and MUTATION + RUIN-RECREATE heuristics in AVG_TEST_MODE in the later 10% time, and determine which of the following three modes --- CO_ONLY_MODE, CO_BUOY_MODE, AVG_BUOY_MODE --- to run in the rest of time. <br>Particularly, the program will turn into SEA_TRENCH_MODE in very early stage, if the DeepDive() (deep local search) consumes too much time.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.AUTO_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="CO_TEST_MODE"><!-- --></A><H3>
CO_TEST_MODE</H3>
<PRE>
public static final int <B>CO_TEST_MODE</B></PRE>
<DL>
<DD>a test mode, usually appears in the first 10% of the time horizon.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.CO_TEST_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="AVG_TEST_MODE"><!-- --></A><H3>
AVG_TEST_MODE</H3>
<PRE>
public static final int <B>AVG_TEST_MODE</B></PRE>
<DL>
<DD>a test mode, usually appears in the second 10% of total time. Enables BUOY during this mode.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.AVG_TEST_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="CO_ONLY_MODE"><!-- --></A><H3>
CO_ONLY_MODE</H3>
<PRE>
public static final int <B>CO_ONLY_MODE</B></PRE>
<DL>
<DD>a standard running mode. <br>Stesses on CROSSOVER moves, MUTATION & RUIN-RECREATE moves are completely ignored.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.CO_ONLY_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="CO_BUOY_MODE"><!-- --></A><H3>
CO_BUOY_MODE</H3>
<PRE>
public static final int <B>CO_BUOY_MODE</B></PRE>
<DL>
<DD>a standard running mode. <br>Enables BUOY. <br>Mostly relies on CROSSOVER moves. But in case the solution meets the BUOY (objValue(solution) < buoyInWater), MUTATION & RUIN-RECREATE moves are included.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.CO_BUOY_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="AVG_BUOY_MODE"><!-- --></A><H3>
AVG_BUOY_MODE</H3>
<PRE>
public static final int <B>AVG_BUOY_MODE</B></PRE>
<DL>
<DD>a standard running mode. <br>Enables BUOY. <br>All low level moves are (almost) equally called by their merits. And in case the move meets the BUOY (objValue(solution) < buoyInWater), MUTATION & RUIN-RECREATE moves are included.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.AVG_BUOY_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SEA_TRENCH_MODE"><!-- --></A><H3>
SEA_TRENCH_MODE</H3>
<PRE>
public static final int <B>SEA_TRENCH_MODE</B></PRE>
<DL>
<DD>a standard running mode. <br>Activated if actions in DeepDive() or Snorkeling() consumes too much time (> 1% time for a dive). <br>In this mode, the DeepDive() will be replaced by SeaTrenchDive() for a fast descending, and the calls of moves are in "run-judge-run" styles, no more "test-judge-run."
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#PearlHunter.SEA_TRENCH_MODE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="modeToPersist"><!-- --></A><H3>
modeToPersist</H3>
<PRE>
public static int <B>modeToPersist</B></PRE>
<DL>
<DD>mode to persist to run. Possible values: <br>AUTO_MODE(default), CO_ONLY_MODE, CO_BUOY_MODE, AVG_BUOY_MODE, SEA_TRENCH_MODE.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="ATT_TEST"><!-- --></A><H3>
ATT_TEST</H3>
<PRE>
public static boolean <B>ATT_TEST</B></PRE>
<DL>
<DD>flag of generating attributes of low level heuristics. <br>Note this flag breaks the normal program modes. <br>false(default) true
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="MOD_TEST"><!-- --></A><H3>
MOD_TEST</H3>
<PRE>
public static boolean <B>MOD_TEST</B></PRE>
<DL>
<DD>flag of generating attributes of modes. <br>Note this flag breaks the normal program modes. <br>false(default) true
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="heuristicsAttributes"><!-- --></A><H3>
heuristicsAttributes</H3>
<PRE>
public static java.lang.String <B>heuristicsAttributes</B></PRE>
<DL>
<DD>returns an attribute matrix of low level heuristic candidates.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="modeAttributes"><!-- --></A><H3>
modeAttributes</H3>
<PRE>
public static java.lang.String <B>modeAttributes</B></PRE>
<DL>
<DD>returns an attribute matrix of standard modes <br>(CO_ONLY_MODE, CO_BUOY_MODE, AVG_BUOY_MODE).
<P>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="PearlHunter(long)"><!-- --></A><H3>
PearlHunter</H3>
<PRE>
public <B>PearlHunter</B>(long seed)</PRE>
<DL>
<DD>Constructs a new Pearl Hunter with a random seed
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the random seed</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="solve(AbstractClasses.ProblemDomain)"><!-- --></A><H3>
solve</H3>
<PRE>
public void <B>solve</B>(AbstractClasses.ProblemDomain problem)</PRE>
<DL>
<DD>This method defines the strategy of the hyper-heuristic.
<p> A typical run (not SEA_TRENCH_MODE):
<br> 1. generates two candidate lists that consist of local search dives, one is set up with depth = 0.1 for Snorkeling(), another with depth = 1.0 for DeepDive(). tests the performances of all candidates, then sorts them.
<br> 2. generates candidate lists of crossover, mutation, ruin-recreate moves, set corresponding param to 0.2, 0.5, 0.8 if the heuristic accepts params. tests and sorts them.
<br> 3. turns into <a href="#CO_TEST_MODE">CO_TEST_MODE</a>, test crossover moves for 10% of time horizon.
<br> 4. turns into <a href="#AVG_TEST_MODE">AVG_TEST_MODE</a>, test mutation and ruin-recreate moves for 10% of time horizon.
<br> 5. judges which mode to run officially (one from <a href="#CO_ONLY_MODE">CO_ONLY</a>, <a href="#CO_BUOY_MODE">CO_BUOY</a>, <a href="#AVG_BUOY_MODE">AVG_BUOY</a>), according to following rules:
<br><pre>
Hmu >= 0.18929
| Hrr >= 0.01538: AVG_BUOY(21.0/1.0)
| Hrr < 0.01538
| | Hdir < 0.06731: AVG_BUOY(6.0/0.0)
| | Hdir >= 0.06731: CO_BUOY(7.0/0.0)
Hmu < 0.18929
| Hdir >= 0.34482: CO_BUOY(10.0/0.0)
| Hdir < 0.34482
| | LSs >= 28.0: CO_ONLY(18.0/1.0)
| | LSs < 28.0
| | | Hall < 59.0: CO_ONLY(10.0/1.0)
| | | Hall >= 59.0
| | | | LSs >= 14.5: CO_BUOY(6.0/0.0)
| | | | LSs < 14.5
| | | | | MUD < 9.0: CO_ONLY(4.0/1.0)
| | | | | MUD >= 9.0
| | | | | | Hall < 78.0: CO_BUOY(2.0/0.0)
| | | | | | Hall >= 78.0: AVG_BUOY(2.0/0.0)
where:
"Top solution" - a solutions s satisfies objValue(s) < objValue(NEXT_BEST_SOLUTION)
Hmu - percent of top solutions found after Mutation moves (including direct result, by Snorkeling(), by DeepDive())
Hrr - percent of top solutions found after RuinRecreate moves (including direct result, by Snorkeling(), by DeepDive())
Hdir - percent of top solutions found immediately after some moves (including three sources of moves: Mutation, RuinRecreate, Crossover)
LSs - Number of CO_ONLY missions completed in CO_TEST_MODE
Hall - Number of top solutions
MUD - Number of top solutions found in the AVG_TEST_MODE mission (Depth of Mutation + RuinRecreate)
</pre>
<br> 6. applies "move*n-dive-move*n-dive" actions according to the determined mode.
<br> Run an uneven sequence for moves until 65% of time horizon has passed from the start of Hunter. E.g., a testing sequence is "ABCDABA" for a move candidate list "ABCD."
<br> In the final 35% time, moves are selected according to how many top solutions have been found in their names.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>solve</CODE> in class <CODE>AbstractClasses.HyperHeuristic</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>problem</CODE> - the problem domain to be solved</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD>this method provides a name
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>toString</CODE> in class <CODE>AbstractClasses.HyperHeuristic</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a string representing the name of the hyper-heuristic</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?PearlHunter.html" target="_top"><B>FRAMES</B></A>
<A HREF="PearlHunter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>