7.3.4.1. Custom Games

  • Prerequisites

  • Setup a Custom Game

    If you already know how to set up coalition/competition, payoff funtion/matrix, and solver. Then, setting up a custom game in MLPro-GT-Native is very simple, where you only need to bring everything together in one method, as follows:

    from mlpro.gt.native.basics import *
    
    class MyGame(GTGame):
    
        C_NAME  = 'MyGame'
    
        def _setup(self, p_mode, p_ada:bool, p_visualize:bool, p_logging) -> Model:
    
            # Setup strategy space
            ...
    
            # Setup a solver, e.g. Random Solver
            ...
    
            # Setup a set of players
            ...
    
            # Setup a set of coalitions
            ...
    
            # Setup a competition (if required)
            ...
    
            # Setup the payoff matrix or function
            self._payoff = ...
    
            return Model