Last change
on this file was 1, checked in by Wouter Pasman, 6 years ago |
Initial import : Genius 9.0.0
|
File size:
816 bytes
|
Line | |
---|
1 | package agents.anac.y2014.KGAgent;
|
---|
2 |
|
---|
3 | import agents.anac.y2014.kGA_gent.library_genetic.CompGene;
|
---|
4 | import agents.anac.y2014.kGA_gent.library_genetic.Gene;
|
---|
5 |
|
---|
6 | public class CompMyBidGene extends CompGene{
|
---|
7 |
|
---|
8 |
|
---|
9 | int type = 0;
|
---|
10 | public CompMyBidGene(int type) {
|
---|
11 | // TODO èâ¡ÂªÃ¥â¹â¢Ã§â?ŸæË�ã�â¢Ã£âÅã�Ÿãâ³ãƳãâ¹ãÆËãÆ©ãâ¯ãâ¿ãƼãÆȋâ¹ãâ¿ãÆâ
|
---|
12 | this.type = type;
|
---|
13 | }
|
---|
14 | public CompMyBidGene(){
|
---|
15 | }
|
---|
16 |
|
---|
17 | @Override
|
---|
18 | public int compare(Gene o1, Gene o2) {
|
---|
19 | // TODO èâ¡ÂªÃ¥â¹â¢Ã§â?ŸæË�ã�â¢Ã£âÅã�ŸãÆ¡ãâ½ãÆÆãÆâ°Ã£Æȋâ¹ãâ¿ãÆâ
|
---|
20 |
|
---|
21 | MyBidGene b1 = (MyBidGene)o1;
|
---|
22 | MyBidGene b2 = (MyBidGene)o2;
|
---|
23 | double d = b1.GetValue(type) - b2.GetValue(type);
|
---|
24 | if(d > 0){
|
---|
25 | return 1;
|
---|
26 | }else if (d<0) {
|
---|
27 | return -1;
|
---|
28 | }else{
|
---|
29 | return 0;
|
---|
30 | }
|
---|
31 | }
|
---|
32 |
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.