1 | package agents.anac.y2013.MetaAgent.parser.cart.tree;
|
---|
2 |
|
---|
3 |
|
---|
4 | public class PrimarySplit extends Split{
|
---|
5 | double _improve;
|
---|
6 | int _missing;
|
---|
7 |
|
---|
8 |
|
---|
9 | private PrimarySplit(String name, double value, Direction direction,
|
---|
10 | double improve, int missing) {
|
---|
11 | super(name,value,direction);
|
---|
12 | this._improve = improve;
|
---|
13 | this._missing = missing;
|
---|
14 | }
|
---|
15 |
|
---|
16 |
|
---|
17 | public static PrimarySplit factory(String text){
|
---|
18 | text=text.trim();
|
---|
19 | String[]wordstext=text.split(" +");
|
---|
20 | String name=wordstext[0];
|
---|
21 | double value=Double.parseDouble(wordstext[2]);
|
---|
22 | Direction dir;
|
---|
23 | if(wordstext[5].contains("left"))
|
---|
24 | dir=Direction.LEFT;
|
---|
25 | else
|
---|
26 | dir=Direction.RIGHT;
|
---|
27 | double improve=Double.parseDouble(Node.substring(text,"improve=",","));
|
---|
28 | int missing=Integer.parseInt(Node.substring(text, "(",text.indexOf("missing")).trim());
|
---|
29 | PrimarySplit s=new PrimarySplit(name,value,dir,improve,missing);
|
---|
30 | return s;
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | public String toString() {
|
---|
36 | return "Split [_name=" + _name + ", _value=" + _value + ", _direction="
|
---|
37 | + _direction + ", _improve=" + _improve + ", _missing=" + _missing
|
---|
38 | + "]";
|
---|
39 | }
|
---|
40 | } |
---|