Exemplo n.º 1
0
#Create memory manager to store dictionary of sensory and motor states
#All use of memory is through use of the memory manager module. 
from memoryManagerClass import memoryManagerClass
global memoryManager
memoryManager = memoryManagerClass("memoryManager")

#Create an instance of a game population module.
from gamePopulationClass import gamePopulationClass
global gamePopulation
gamePopulation = gamePopulationClass("gamePopulation", 1)

#Create an instance of an actor population module. 
from actorPopulationClass import actorPopulationClass
global actorPopulation
actorPopulation = actorPopulationClass("actorPopulation", 3, from_file)

#Create an instance of a basic motor function module. 
from basicMotorFunctionClass import basicMotorFunctionClass
global bmf
bmf = basicMotorFunctionClass("bmf")

#from drawMolClass import drawMolClass
#global drawMol
#drawMol = drawMolClass("drawMol")

NUM_EXPERIMENTS = 1000000
EXPERIMENTS_PER_GENERATION = 1

def saveGenomes(j):
    output = open('actordata.pkl'  + str(j), 'wb')
Exemplo n.º 2
0
PARENTBROKER_PORT = 9559
broker = ALBroker(LOCALBROKER_NAME, LOCALBROKER_IP, LOCALBROKER_PORT,
                  PARENTBROKER_IP, PARENTBROKER_PORT)

#INITIALIZATION

#Create an instance of a shared data class that stores indexed pointers to data and events.
from sharedDataClass import sharedDataClass
global sharedData
sharedData = sharedDataClass("sharedData")

#Create an instance of an actor population module.
from actorPopulationClass import actorPopulationClass
global actorPopulation
#actorPopulation = actorPopulationClass("actorPopulation")
actorPopulation = actorPopulationClass("actorPopulation", 1)

#Create an instance of a basic motor function module.
from basicMotorFunctionClass import basicMotorFunctionClass
global bmf
bmf = basicMotorFunctionClass("bmf")

#START MAIN SENSORIMOTOR LOOP (WITH FIXED ACTORS,NO EVOLUTION)

##
##simOn = True
##i = 0
##while simOn is True:
##    print i
##    i = i +1
##    #1. Determine actor activation state from data.
Exemplo n.º 3
0
#Create memory manager to store dictionary of sensory and motor states
#All use of memory is through use of the memory manager module. 
from memoryManagerClass import memoryManagerClass
global memoryManager
memoryManager = memoryManagerClass("memoryManager")

#Create an instance of a game population module.
from gamePopulationClass import gamePopulationClass
global gamePopulation
gamePopulation = gamePopulationClass("gamePopulation", 1)

#Create an instance of an actor population module. 
from actorPopulationClass import actorPopulationClass
global actorPopulation
actorPopulation = actorPopulationClass("actorPopulation", 2, from_file)

#Create an instance of a basic motor function module. 
from basicMotorFunctionClass import basicMotorFunctionClass
global bmf
bmf = basicMotorFunctionClass("bmf")

NUM_EXPERIMENTS = 100000
EXPERIMENTS_PER_GENERATION = 1

def saveGenomes(j):
    output = open('actordata.pkl'  + str(j), 'wb')
    data1 = actorPopulation.getActorPickles()
    data = [data1]
 #   pprint.pprint(data1)
    pickle.dump(data, output, -1)
Exemplo n.º 4
0
LOCALBROKER_PORT=9560
PARENTBROKER_IP=  "ctf.local" #"naoFernando.local"
PARENTBROKER_PORT=9559
broker=ALBroker(LOCALBROKER_NAME,LOCALBROKER_IP,LOCALBROKER_PORT,PARENTBROKER_IP,PARENTBROKER_PORT)

#INITIALIZATION

#Create an instance of a shared data class that stores indexed pointers to data and events.
from sharedDataClass import sharedDataClass
global sharedData
sharedData = sharedDataClass("sharedData")

#Create an instance of an actor population module. 
from actorPopulationClass import actorPopulationClass
global actorPopulation
actorPopulation = actorPopulationClass("actorPopulation")

#Create an instance of a basic motor function module. 
from basicMotorFunctionClass import basicMotorFunctionClass
global bmf
bmf = basicMotorFunctionClass("bmf")

#START MAIN SENSORIMOTOR LOOP (WITH FIXED ACTORS,NO EVOLUTION)

##
##simOn = True
##i = 0
##while simOn is True:
##    print i
##    i = i +1
##    #1. Determine actor activation state from data.