public bool simulateState(Vertex state)
 {
     currentState = state;
     state.simulate(Host);
     return true;
 }
        protected bool activateState(Vertex state, Dictionary<string, ValueSpecification> p)
        {
            // StreamWriter file = MascaretApplication.Instance.logfile;

              //  file.WriteLine("Activating State : " + state.name); file.Flush();
            currentState = state;

               if (state as FinalState == null)
                toStop = true;

            be = currentState.activate(Host, p);

            if (be != null)
            {

                currentState.running = true;
                //callBack function
                be.addCallbackOnBehaviorStop(onBehaviorStop);
                currentActionDone = false;
            }

            foreach (Transition currentTransition in currentState.Outgoing)
            {
                foreach (Trigger currentTrigger in currentTransition.Trigger)
                {
                    if (currentTrigger.MEvent.Type == "ChangeEvent")
                    {
                        ChangeEvent ce = currentTrigger.MEvent as ChangeEvent;
                        Expression exp = (Expression)ce.ChangeExpression.clone();
                        //callBack function
                        //evalutateExpression function
                    }
                }
            }

            return true;
        }
 public void setCurrentState(string name)
 {
     Region region = getStateMachine().Region[0];
     foreach (Vertex currentVertex in region.Vertices)
     {
         if (currentVertex.name == name)
             currentState = currentVertex;
     }
 }