示例#1
0
def singleRun():
    params = decision.Params()
    params.decisionType = 'probabilistic'
    params.memory = False 
    params.nSteps = 1000
    params.nAgents = 1
    params.output = 'output_dmp_0.csv'
    decision.run(params)
示例#2
0
def singleRun():
    params = decision.Params()
    params.decisionType = "probabilistic"
    params.memory = False
    params.nSteps = 1000
    params.nAgents = 1
    params.output = "output_dmp_0.csv"
    decision.run(params)
示例#3
0
def singleRun():
    params = decision.Params()
    params.nSteps = 100
    params.nAgents = 10
    params.output = 'output.csv'
    params.maxEnergy = 10
    params.energyCost = 1
    params.resourceGrowthRate = 1 
    params.xDim = 10
    params.yDim = 10
    decision.run(params)
示例#4
0
def equilibrium():
    params = decision.Params()
    params.nSteps = 5000
    params.radius = 1
    params.nAgents = 30
    params.output = 'fig1.csv'
    params.maxEnergy = 10
    params.energyCost = 2
    params.resourceGrowthRate = 2
    params.xDim = 30
    params.yDim = 30
    decision.run(params)
示例#5
0
def multifinality():    
    repetitions = 3
    params = decision.Params()
    params.nSteps = 300
    params.radius = 3
    params.output = 'fig2b.csv'
    params.maxEnergy = 50
    params.energyCost = 10
    params.resourceGrowthRate = 10
    params.nAgents = 50
    params.xDim = 30
    params.yDim = 30
    params.oneFile = True

    for i in range(repetitions):
        print('run:',i,'from:',repetitions)
        params.numRun = i
        decision.run(params)
示例#6
0
def equifinality():    
    repetitions = 10
    params = decision.Params()
    params.nSteps = 150
    params.radius = 1
    params.output = 'fig2a.csv'
    params.maxEnergy = 10
    params.energyCost = 3
    params.resourceGrowthRate = 3
    params.xDim = 30
    params.yDim = 30
    params.oneFile = True

    for i in range(repetitions):
        print('run:',i,'from:',repetitions)
        params.numRun = i
        params.nAgents = random.randint(1,200)
        decision.run(params)
示例#7
0
def all():
    # experiment
    numRuns = 10

    decisionTypeSweep = ["greedy", "probabilistic"]
    memoryMapSweep = [True, False]

    params = decision.Params()

    totalRuns = 0
    for i in decisionTypeSweep:
        for j in memoryMapSweep:
            params.decisionType = i
            params.memory = j
            for run in range(0, numRuns):
                print("run:", totalRuns + 1, "of:", numRuns * len(memoryMapSweep) * len(decisionTypeSweep))
                params.numRun = totalRuns
                params.output = "output_dmp_" + str(params.numRun) + ".csv"
                totalRuns += 1
                decision.run(params)
示例#8
0
def all():
    # experiment
    numRuns = 10

    decisionTypeSweep = ['greedy','probabilistic']
    memoryMapSweep = [True, False]

    params = decision.Params()

    totalRuns = 0
    for i in decisionTypeSweep:
        for j in memoryMapSweep:
            params.decisionType = i
            params.memory = j
            for run in range(0, numRuns):
                print('run:',totalRuns+1,'of:',numRuns*len(memoryMapSweep)*len(decisionTypeSweep))
                params.numRun = totalRuns
                params.output = 'output_dmp_'+str(params.numRun)+'.csv'
                totalRuns += 1
                decision.run(params)
示例#9
0
def convergence():
    # experiment
    numRuns = 10

    decisionTypeSweep = ["greedy"]
    memoryMapSweep = [False]

    params = decision.Params()
    params.nSteps = 500

    totalRuns = 0
    for i in decisionTypeSweep:
        for j in memoryMapSweep:
            params.decisionType = i
            params.memory = j
            for run in range(0, numRuns):
                print("run:", totalRuns + 1, "of:", numRuns * len(memoryMapSweep) * len(decisionTypeSweep))
                params.numRun = totalRuns
                params.nAgents = random.randint(1, 200)
                params.output = "output_dmp_" + str(params.numRun) + ".csv"
                totalRuns += 1
                decision.run(params)
示例#10
0
def convergence():
   # experiment
    numRuns = 10

    decisionTypeSweep = ['greedy']
    memoryMapSweep = [False]

    params = decision.Params()
    params.nSteps = 500

    totalRuns = 0
    for i in decisionTypeSweep:
        for j in memoryMapSweep:
            params.decisionType = i
            params.memory = j
            for run in range(0, numRuns):
                print('run:',totalRuns+1,'of:',numRuns*len(memoryMapSweep)*len(decisionTypeSweep))
                params.numRun = totalRuns
                params.nAgents = random.randint(1,200)
                params.output = 'output_dmp_'+str(params.numRun)+'.csv'
                totalRuns += 1
                decision.run(params)
示例#11
0
def exploreRadius():
    repetitions = 1000
    radiusValues = range(1,31)
    numRuns = repetitions*len(radiusValues)
    numRun = 0
    for i in radiusValues:
        for j in range(repetitions):
            params = decision.Params()
            params.oneFile = False 
            params.nSteps = 5001
            params.nAgents = 50
            params.maxEnergy = 100
            params.energyCost = 25
            params.resourceGrowthRate = 25
            params.xDim = 30
            params.yDim = 30
            params.numRun = numRun
            params.radius = i
            params.output = 'output_dec_'+str(numRun).zfill(5)+'.csv'
            print('run:',numRun+1,'of:',numRuns,'radius:',params.radius) 
            decision.run(params)
            numRun += 1