List <OptionN> createOptFromSubGoals(List <SubGoal> subgoals)
    {
        List <OptionN> options = new List <OptionN>();

        for (int i = 0; i < subgoals.Count; i++)
        {
            SubGoal s = subgoals[i];
            OptionN o = new OptionN(s.State, this);
            options.Add(o);
            for (int j = 0; j < Model[s.State].Count; j++)
            {
                if (Model[s.State][j] == null)
                {
                    continue;
                }
                if (Q[s.State].Actions[j].O != null)
                {
                    continue;
                }
                o.AddSASp(s.State, j, Model[s.State][j].sP);
                constOptionN(subgoals, s, o, Model[s.State][j].sP);
            }
        }
        return(options);
    }
 void constOptionN(List <SubGoal> subgoals, SubGoal s, OptionN o, int state)
 {
     if (o.initSet.Keys.Contains(state))
     {
         return;
     }
     if (isSubgoal(state))
     {
         return;
     }
     Q[state].Actions.Add(new Action(o));
     for (int i = 0; i < Model[state].Count; i++)
     {
         if (Model[state][i] != null && Q[state].Actions[i].O == null)
         {
             o.AddSASp(state, i, Model[state][i].sP);
             constOptionN(subgoals, s, o, Model[state][i].sP);
         }
     }
 }