Esempio n. 1
0
def produce_all_agents_plots(number_of_games):
    """
    Given the number of games, produces all the plots.
    """
    print('Plotting market maker plots')
    for (demand, supply) in setup.get_grid_demand_impressions():
        produce_agents_plots(number_of_games, demand, supply)
Esempio n. 2
0
def plot_all_soft_expected_agents_pure_nash(number_of_games):
    """
    Wrapper to plot all expected number of strategies.
    """
    for (demand, supply) in setup.get_grid_demand_impressions():
        print('Expected Pure Nash for (demand, supply) = (', demand, ',',
              supply, ')')
        dir_location = setup.get_agent_dir_location(number_of_games, supply,
                                                    demand)
        plot_soft_expected_agents_pure_nash(number_of_games, dir_location,
                                            demand, supply)
Esempio n. 3
0
def plot_all_proportion_pure_nash(number_of_games):
    """
    Save all the best response graphs to an image and the
    image of the proportion of pure nash
    """
    for (demand, supply) in setup.get_grid_demand_impressions():
        print('Proportion Graphs Pure Nash for (demand, supply) = (', demand,
              ',', supply, ')')
        dir_location = setup.get_agent_dir_location(number_of_games, supply,
                                                    demand)
        dict_of_pure_nash = mean_best_response_graphs.get_dict_of_pure_nash(
            number_of_games, demand, supply, dir_location)
        plot_proportion_pure_nash(number_of_games, demand, supply,
                                  dict_of_pure_nash)
Esempio n. 4
0
def plot_all_soft_deviation_graph(number_of_games):
    """
    Wrapper to plot all soft deviation graphs.
    """
    for (demand, supply) in setup.get_grid_demand_impressions():
        print('Soft Deviation Graphs for (demand, supply) = (', demand, ',',
              supply, ')')
        for i in range(2, 20):
            print('\t Number of Agents: ', i)
            profile_data = produce_profile_data(number_of_games, i, supply,
                                                demand)
            DG = produce_soft_deviation_graph(profile_data)
            map_steady_dist = compute_steady_state(DG)
            plot_soft_deviation_graph(number_of_games, DG, map_steady_dist,
                                      profile_data, demand, supply)
Esempio n. 5
0
def produce_all_latex_code(number_of_games):
    """
    Produces all the latex code to show results.
    """
    for (demand, supply) in setup.get_grid_demand_impressions():
        image_prefix = 'demand-factor-' + demand.replace(
            '.', '_') + '-' + supply + 'impressions-'
        latex = """
    \\newpage
    \subsection*{Demand Factor """ + demand + """, """ + supply + """ impressions}
    \hspace*{-1in}
    \includegraphics[scale=0.65]{/home/eareyanv/workspace/adxgame/data/plot/""" + image_prefix + """SIvWE}
    \includegraphics[scale=0.65]{/home/eareyanv/workspace/adxgame/data/plot/""" + image_prefix + """SIvWF}
    
    \hspace*{-1in}
    \includegraphics[scale=0.65]{/home/eareyanv/workspace/adxgame/data/plot/""" + image_prefix + """WEvSI}
    \includegraphics[scale=0.65]{/home/eareyanv/workspace/adxgame/data/plot/""" + image_prefix + """WEvWF}
    
    \hspace*{-1in}
    \includegraphics[scale=0.65]{/home/eareyanv/workspace/adxgame/data/plot/""" + image_prefix + """WFvSI}
    \includegraphics[scale=0.65]{/home/eareyanv/workspace/adxgame/data/plot/""" + image_prefix + """WFvWE}
        """
        print(latex)
Esempio n. 6
0
def produce_all_market_maker_plots(number_of_games):
    print('Plotting market maker plots')
    for (demand, supply) in setup.get_grid_demand_impressions():
        print(demand, supply)
        produce_market_maker_plots(number_of_games, demand, supply)