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:
716 bytes
|
Line | |
---|
1 | package agents.anac.y2013.MetaAgent.parser.cart.tree;
|
---|
2 | import java.util.HashMap;
|
---|
3 |
|
---|
4 | public class Split {
|
---|
5 |
|
---|
6 | public enum Direction{
|
---|
7 | LEFT,RIGHT
|
---|
8 | }
|
---|
9 |
|
---|
10 | protected String _name;
|
---|
11 | protected double _value;
|
---|
12 | protected Direction _direction;
|
---|
13 |
|
---|
14 | protected Split(String _name, double _value, Direction _direction) {
|
---|
15 | this._name = _name;
|
---|
16 | this._value = _value;
|
---|
17 | this._direction = _direction;
|
---|
18 | }
|
---|
19 |
|
---|
20 | public String getName() {
|
---|
21 | return this._name;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public Direction getDirection(HashMap<String, Double> values) {
|
---|
25 | double value=values.get(this._name);
|
---|
26 | if(value<this._value)
|
---|
27 | return this._direction;
|
---|
28 | if(this._direction==Direction.LEFT)
|
---|
29 | return Direction.RIGHT;
|
---|
30 | return Direction.LEFT;
|
---|
31 | }
|
---|
32 |
|
---|
33 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.