/** @param parent the parent to set */ public void setParent(Node parent) { int parentDirectionIndex = -1; if (Arrays.asList(forwardChildren).contains(parent)) { this.setDirection(NodeDirection.REVERSE); parentDirectionIndex = Arrays.asList(forwardChildren).indexOf(parent); } if (Arrays.asList(reverseChildren).contains(parent)) { this.setDirection(NodeDirection.FORWARD); parentDirectionIndex = Arrays.asList(reverseChildren).indexOf(parent) + 3; } if (getTyp() == NodeTyp.Y) { parentDirectionIndex = parentDirectionIndex + 6; } if (parentDirectionIndex < 0 || parentDirectionIndex > 11 || parent == null) { parentDirection = ParentDirection.NONE; } else { parentDirection = ParentDirection.values()[parentDirectionIndex]; } // System.out.println("index: "+parentDirectionIndex+" enum: "+parentDirection); if (parent != null && getTyp() == parent.getTyp()) { setStraightCount(parent.getStraightCount() + 1); } else { setStraightCount(0); } this.parent = parent; changedValue(); }
public void setHeuristicValue(double heuristicValue) { this.heuristicValue = heuristicValue; changedValue(); }
/** @param value the value to set */ public void setValue(double value) { this.value = value; changedValue(); }