示例#1
0
文件: start.py 项目: ziwangdeng/abce
def main():
    parameters = {'name': 'name', 'rounds': 300}

    s = Simulation(rounds=parameters['rounds'], cores=8)
    action_list = [  # (('myagent', 'youragent'), 'compute'),
        ('youragent', 's'), ('myagent', 'g')
    ]
    s.add_action_list(action_list)

    s.build_agents(MyAgent, 50000)
    s.build_agents(YourAgent, 50000)

    s.run()
示例#2
0
def main():
    parameters = {'name': 'name', 'num_rounds': 10}

    s = Simulation(parameters)
    action_list = [  # (('myagent', 'youragent'), 'compute'),
        ('youragent', 's'), ('myagent', 'g')
    ]
    s.add_action_list(action_list)

    s.build_agents(MyAgent, 50000)
    s.build_agents(YourAgent, 50000)

    s.run(parallel=True)
示例#3
0
文件: start.py 项目: ziwangdeng/abce
def main():
    for params in simulation_parameters:
        s = Simulation(params)

        s.declare_round_endowment('field', 60, 'corn')
        s.declare_round_endowment('shares', 60, 'money')

        f = s.build_agents(Firm, 'firm', 1)
        h = s.build_agents(Household, 'household', 1)
        for r in s.next_round():
            for i in range(60):
                f.do('selling')
                h.do('buying')
                h.do('checking')

        s.run()
示例#4
0
def main():
    for params in simulation_parameters:
        s = Simulation(params)

        s.declare_round_endowment('field', 60, 'corn')
        s.declare_round_endowment('shares', 60, 'money')

        f = s.build_agents(Firm, 'firm', 1)
        h = s.build_agents(Household, 'household', 1)
        for r in s.next_round():
            for i in range(60):
                f.do('selling')
                h.do('buying')
                h.do('checking')

        s.run()
示例#5
0
def main():
    parameters = {
        'name': 'name',
        'rounds': 300
    }

    s = Simulation(rounds=parameters['rounds'], cores=8)
    action_list = [  # (('myagent', 'youragent'), 'compute'),
        ('youragent', 's'),
        ('myagent', 'g')]
    s.add_action_list(action_list)

    s.build_agents(MyAgent, 50000)
    s.build_agents(YourAgent, 50000)

    s.run()
def main():
    parameters = {
        'name': 'name',
        'num_rounds': 10
    }

    s = Simulation(parameters)
    action_list = [  # (('myagent', 'youragent'), 'compute'),
        ('youragent', 's'),
        ('myagent', 'g')]
    s.add_action_list(action_list)

    s.build_agents(MyAgent, 50000)
    s.build_agents(YourAgent, 50000)

    s.run(parallel=True)