Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKBJavaConnector/ECJClient/src/ec/rule/RuleSpecies.java @ 6703

Last change on this file since 6703 was 6152, checked in by bfarka, 14 years ago

added ecj and custom statistics to communicate with the okb services #1441

File size: 1.6 KB
Line 
1/*
2  Copyright 2006 by Sean Luke and George Mason University
3  Licensed under the Academic Free License version 3.0
4  See the file "LICENSE" for more information
5*/
6
7
8package ec.rule;
9import ec.*;
10import ec.util.*;
11import java.io.*;
12
13/*
14 * RuleSpecies.java
15 *
16 * Created: Wed Feb 31 17:42:10 2001
17 * By: Liviu Panait
18 */
19
20/**
21 * RuleSpecies is a simple individual which is suitable as a species
22 * for rule sets subpopulations.  RuleSpecies' individuals must be RuleIndividuals,
23 * and often their pipelines are RuleBreedingPipelines (at any rate,
24 * the pipelines will have to return members of RuleSpecies!).
25 *
26 <p><b>Default Base</b><br>
27 rule.species
28
29 *
30 * @author Liviu Panait
31 * @version 1.0
32 */
33
34public class RuleSpecies extends Species
35    {
36    public static final String P_RULESPECIES = "species";
37
38    public Parameter defaultBase()
39        {
40        return RuleDefaults.base().push(P_RULESPECIES);
41        }
42
43    public void setup(final EvolutionState state, final Parameter base)
44        {
45        super.setup(state,base);
46
47        // check to make sure that our individual prototype is a RuleIndividual
48        if (!(i_prototype instanceof RuleIndividual))
49            state.output.fatal("The Individual class for the Species " + getClass().getName() + " is must be a subclass of ec.rule.RuleIndividual.", base );
50        }   
51
52    public Individual newIndividual(EvolutionState state, int thread)
53        {
54        RuleIndividual newind = (RuleIndividual)(super.newIndividual(state, thread));
55       
56        newind.reset( state, thread);
57
58        return newind;
59        }
60    }
Note: See TracBrowser for help on using the repository browser.