def __init__(self, tasks, agents, market, profile=None,branchOutages=None):
        """ Initialises the market experiment.
        """
        super(MarketExperiment, self).__init__()
        assert len(tasks) == len(agents)

        #: Tasks associate and agent with its environment.
        self.tasks = tasks

        #: Agents capable of producing actions based on previous observations.
        self.agents = agents

        #: Market to which agents submit offers/bids.
        self.market = market

        #: Load profile.  Either a 1D array used for all episodes or a 2D array
        #  where the number of rows equals the number of episodes.
#        self._profile = None
        self._pcycle = None
        self.profile = array([1.0]) if profile is None else profile

        #: List of branch outage probabilities.
        self.branchOutages = branchOutages

        self.stepid = 0

#        self.do_optimisation = {}
#        self.optimisers = {}
#
#        for task, agent in zip(self.tasks, self.agents):
#            if isinstance(agent, OptimizationAgent):
#                self.do_optimisation[agent] = True
#                self.optimisers[agent] = agent.learner
#                self.optimisers[agent].setEvaluator(task, agent.module)
#                self.optimisers[agent].maxEvaluations = \
#                    self.optimisers[agent].numEvaluations
#            else:
#                self.do_optimisation[agent] = False

        #: Save the demand at each bus.
        self.pdemand = {}
        for bus in self.market.case.buses:
            self.pdemand[bus] = bus.p_demand
def __init__ ( self , tasks , agents , market , profile = None , branchOutages = None ) : super ( MarketExperiment , self ) . __init__ ( ) assert len ( tasks ) == len ( agents ) self . tasks = tasks self . agents = agents self . market = market self . _pcycle = None self . profile = array ( [ 1.0 ] ) if profile is None else profile self . branchOutages = branchOutages self . stepid = 0 self . pdemand = { } for bus in self . market . case . buses : self . pdemand [ bus ] = bus . p_demand
Initialises the market experiment.