public int getActionIndex( String action ){
        if( action.equals(NOP) ){
            return (getActionsNumber() - 1);
        }else{
            int[] values = new int[3];
            int k = 0;
            try {
                StreamTokenizer tokenizer = new StreamTokenizer(new
                        StringReader(
                                action));
                while (k < 3 && tokenizer.nextToken() != StreamTokenizer.TT_EOF) {
                    if (tokenizer.ttype == StreamTokenizer.TT_NUMBER) {

                        values[k] = (int) (tokenizer.nval);
                        k++;
                    }
                }
                return values[0] * DIGITS * DIGITS + values[1] * DIGITS +
                        values[2] - 1;
            } catch (Exception e) {
                return -1;
            }
        }
    }