source: src/main/java/agents/anac/y2013/MetaAgent/parser/cart/tree/PrimarySplit.java

Last change on this file was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.1 KB
Line 
1package agents.anac.y2013.MetaAgent.parser.cart.tree;
2
3
4public class PrimarySplit extends Split{
5 double _improve;
6 int _missing;
7
8
9private 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
17public 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
35public String toString() {
36 return "Split [_name=" + _name + ", _value=" + _value + ", _direction="
37 + _direction + ", _improve=" + _improve + ", _missing=" + _missing
38 + "]";
39}
40}
Note: See TracBrowser for help on using the repository browser.