1 package hero.entity; 2 import hero.interfaces.BnNodeLocal; 3 import hero.interfaces.Constants; 4 5 public class TraditionalAutomaticNodeState extends NodeState implements java.io.Serializable { 6 7 8 private static int[][] nodeTransition= { 9 { 10 Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 25 Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 40 Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 55 Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPATING, Constants.Nd.EXECUTING, },{ 70 Constants.Nd.INITIAL, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 85 Constants.Nd.INITIAL, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED , Constants.Nd.BAD_TRANSITION, Constants.Nd.INITIAL, Constants.Nd.INITIAL, },{ 100 Constants.Nd.TERMINATED, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.READY, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.EXEC_SUSPENDED, Constants.Nd.EXEC_SUSPENDED, },{ 115 Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.DEAD, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.DEAD, Constants.Nd.DEAD, } 130 }; 131 132 public TraditionalAutomaticNodeState() { 133 } 134 135 public int computeState(BnNodeLocal node,int operation) { 136 return nodeTransition[operation][node.getState()]; 137 } 138 139 140 } 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | Popular Tags |