source: src/main/java/agents/anac/y2014/KGAgent/CompMyBidGene.java@ 126

Last change on this file since 126 was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 816 bytes
Line 
1package agents.anac.y2014.KGAgent;
2
3import agents.anac.y2014.kGA_gent.library_genetic.CompGene;
4import agents.anac.y2014.kGA_gent.library_genetic.Gene;
5
6public 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.