Constructor Function is not working properly : <p>I wrote a constructor function for a class RandomGame which inherits from a different class, SGGame. However, the constructor is not functioning properly. </p>

<p>It is supposed to create a stochastic game with random payoffs and transition probabilities given interger inputs of number of players, actions, and states. Right now, it is always creating a game with two players, one state, and one action, regardless of inputs. </p>

<p>Here is the constructor function: </p>

<pre><code>class RandomGame : public SGGame
{
private:
  int numactions;
public:
  RandomGame(int numPlayers,
             int numStates,
             int numactions)
  {

          unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
          std::default_random_engine generator (seed);

          std::uniform_real_distribution&lt;double&gt; distribution(1e-6,1-(1e-6));
          double delta = distribution(generator);

          vector&lt;bool&gt; unconstrained(numPlayers,false);

          vector&lt; vector&lt; int &gt; &gt; numActions(numStates,vector&lt;int&gt;(numPlayers,numactions));
          vector&lt;int&gt; numActions_total(numStates,pow(numactions, numPlayers));

  // Payoffs

          vector&lt; vector&lt; vector&lt;double&gt; &gt; &gt;
                  payoffs(numStates,vector&lt; vector&lt;double&gt; &gt;(pow(numactions, numPla
yers),vector&lt;double&gt;(numPlayers,0.0)));
          unsigned int i,j,k,l;
          for(i=0;i&lt;numStates;i++)
          {
            for(j=0;j&lt;numActions_total[i];j++)
            {
               for(k=0;k&lt;numPlayers;k++)
               {
                 std::uniform_real_distribution&lt;double&gt; distribution(0,10);

                 payoffs[i][j][k] = distribution(generator);
               }
            }
          }
  // Transition probabilities
          vector &lt; vector&lt; vector&lt;double&gt; &gt; &gt;
                  probabilities(numStates,vector&lt; vector&lt;double&gt; &gt;(pow(numactions,
numPlayers), vector&lt;double&gt;(numStates,1.0))); // 1.0 as initial value, but then ran
domize
          // randomize transition probabilities
          double prob_sum;
          for(i=0;i&lt;numStates;i++)
          {
            for(j=0;j&lt;numActions_total[i];j++)
            {
              prob_sum = 0.0;
              for(k=0;k&lt;numStates;k++)
              {
                std::uniform_real_distribution&lt;double&gt; distribution(0,1.0);
                probabilities[i][j][k] = distribution(generator);
                // normalize probabilities
                prob_sum += probabilities[i][j][k];
              }
              for(k=0;k&lt;numStates;k++)
              {
                probabilities[i][j][k] = probabilities[i][j][k]/prob_sum;
              }
            }
          }
          SGGame game(delta,
                      numStates,
                      numActions,
                      payoffs,
                      probabilities,
                      unconstrained);
  }

}; ```

// decleration of the class SGGame: the constructor I call at the bottom of that code uses an SGGame constructor which creates an SGGame with the given inputs. 

``` ```
class SGGame
{
private:
  double delta; /*!&lt; The discount factor. */
  int numPlayers; /*!&lt; The number of players. */
  int numStates; /*!&lt; The number of states, must be at least 1. */
  vector&lt; vector&lt;int&gt; &gt; numActions; /*!&lt; Gives the number of each
                                       player's actions in each
                                       state. In particular, player i
                                       has numActions[s][i] actions in
                                       state s. Should note that a
                                       pair (a1,a2) is mapped into an
                                       action profile using the
                                       formula
                                       a=a1+a2*numActions[s][a1], and
                                       generalized to n&gt;2. */
  vector&lt;int&gt; numActions_total; /*!&lt; Total number of action profiles
                                   for each state. */

  vector&lt; vector&lt;SGPoint&gt; &gt; payoffs; /*!&lt; Gives the payoffs of the
                                        players as a function of the
                                        action profile. In particular,
                                        payoffs[s][a][i] are player
                                        i's payoffs in state s when
                                        action profile a is played. */

  vector&lt; vector&lt; vector&lt;double&gt; &gt; &gt; probabilities; /*!&lt; State
                                                       transition
                                                       probabilities:
                                                       probabilities[s][a][s']
                                                       is the
                                                       probability of
                                                       transitioning
                                                       to state s'
                                                       when action
                                                       profile a is
                                                       played in state
                                                       s. */
 vector&lt; vector&lt;bool&gt; &gt; eqActions; /*!&lt; Indicates which action profiles
                                   are allowed to be played on path in
                                   each state. By default, initialized
                                   to true for all action
                                   profiles. Allows one to, for
                                   example, look at strongly symmetric
                                   equilibria (by first excluding
                                   asymmetric action profiles from the
                                   lists). Players can always deviate
                                   to action profiles which are not
                                   allowed on path. */

  vector&lt;bool&gt; unconstrained; /*!&lt; If unconstrained[i]=true, the
                                 algorithm will not impose incentive
                                 compatibility as a constraint for
                                 player i. */ ```

// call to the constructor which is not working properly: 
``` ```
RandomGame game(2,3,4); ```
</code></pre>
