1 package hero.entity; 2 24 import hero.interfaces.BnNodeLocal; 25 import hero.interfaces.Constants; 26 27 import org.apache.log4j.Category; 28 29 public class AutomaticNodeState extends NodeState implements java.io.Serializable { 30 31 private static final Category log = Category.getInstance(AutomaticNodeState.class); 33 34 35 private static int[][] nodeTransition= { 36 { 37 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, },{ 52 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, },{ 67 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, },{ 82 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, },{ 97 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, },{ 112 Constants.Nd.ANTICIPATING, Constants.Nd.ANTICIPATING, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPATING, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPATING, Constants.Nd.ANTICIPATING, 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, },{ 127 Constants.Nd.TERMINATED, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.TERMINATED, 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, },{ 142 Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.DEAD, 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.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, } 157 }; 158 159 public AutomaticNodeState() { 160 } 161 162 public int computeState(BnNodeLocal node,int operation) { 163 log.debug("computeState: node="+node.getName()+" operation="+Constants.Nd.operationName[operation]); 164 return nodeTransition[operation][node.getState()]; 165 } 166 167 168 } 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | Popular Tags |