当前位置: 首页>>代码示例>>Python>>正文


Python NodeGroup.startGroup方法代码示例

本文整理汇总了Python中ctu.nengoros.comm.nodeFactory.NodeGroup.startGroup方法的典型用法代码示例。如果您正苦于以下问题:Python NodeGroup.startGroup方法的具体用法?Python NodeGroup.startGroup怎么用?Python NodeGroup.startGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ctu.nengoros.comm.nodeFactory.NodeGroup的用法示例。


在下文中一共展示了NodeGroup.startGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initVivae

# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def initVivae(numsensors):
    modem  = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem";   
    server = "vivae.ros.simulator.server.SimulatorServer"        		# start the simulator server in own thread
    # Or it is possible to call the Vivae as a standalone application in the similar way:
    #server = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]

    # create group of nodes
    g = NodeGroup("vivae", True);               # create default group of nodes
    g.addNode(server, "SimulatorServer", "java");   # run the simulator..
    g.addNode(modem,"modem","modem")              # add default modem..
    g.startGroup()                              # start group normally

    #time.sleep(3)    # if the process is native, it takes longer time to init the services !!      TODO           
    simulator = NeuralModule('VivaeSimulator', g)  # create NeuralModule which is able to add/remove agents

    sc = simulator.getControls();     # this starts the control services..
    sc.callSetVisibility(True);              # make simulation window visible..
    many=net.add(simulator)                 # add it to the Nengo network

    sc.callLoadMap('data/scenarios/test/walls.svg')  

    #addAgent(name,numSensors, maxDistance, frictionSensor) 
    sc.addAgent('a',2*numsensors,    120          ,0)
    sc.callStartSimulation()
    return simulator;
开发者ID:jvitku,项目名称:vivae,代码行数:27,代码来源:0xPRegulator_run.py

示例2: initVivae

# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def initVivae(numsensors):
    modem  = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem";   # custom modem here
    server = "vivae.ros.simulatorControlsServer.ControlsServer"        # call Vivae as a thread in Java from this process
    # Call Vivae as an external process
    #server = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]

    # create group of nodes
    g = NodeGroup("vivae", True);               # create default group of nodes
    g.addNode(server, "vivaeSimulator", "java");   # run the simulator..
    g.addNode(modem,"modem","modem")              # add default modem..
    g.startGroup()                              # start group normally

    #time.sleep(3)    # if the process is native, it takes longer time to init the services !!                 
    simulator = NeuralModule('VivaeSimulator', g)  # create NeuralModule which is able to add/remove agents

    vivae = simulator.getControls();     # this starts the control services..
    vivae.setVisible(True);              # make simulation window visible..
    many=net.add(simulator)                 # add it to the Nengo network

    vivae.loadMap('data/scenarios/test/walls.svg')  

    #addAgent(name,numSensors, maxDistance, frictionSensor) 
    vivae.addAgent('a',2*numsensors,    120          ,0)
    vivae.start()
    return simulator;
开发者ID:jvitku,项目名称:nengo_1.4,代码行数:27,代码来源:vivae2222.py

示例3: make

# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def make(net,name='Vivae Simulator', mapName='arena1.svg', numSensors=4,maxdist=30,frictdist=50,independent=True, useQuick=True):
    
    numSensors = numSensors*2
    mn = 'data/scenarios/'+mapName

    # note that simulator is started externally, since SVG loaded in vivae hanged otherwise from unknown reason..
    modem  = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem";   # custom modem here
    server = "vivae.ros.simulatorControlsServer.ControlsServer"         # call Vivae as a thread in Java from this process
    vv  = ["./sb/../../../../simulators/vivae/build/install/vivae/bin/vivae","vivae.ros.simulatorControlsServer.ControlsServer"]
    vvj = ["vivae.ros.simulatorControlsServer.ControlsServer"]
    
    # create group of nodes
    g = NodeGroup("vivae", True);           # if nameSpace not defined, create independent group
    #g.addNode(server,"vivaeSimulator", "java");   # run the simulator..
    #g.addNode(vv, "vivaeSimulator", "native");  # run the simulator..
    g.addNode(vvj, "vivaeSimulator", "java");  # run the simulator..
    g.addNode(modem,"modem","modem")              # add default modem..
    g.startGroup()                              # start group normally

    #modem = g.getModem()
    #time.sleep(3)    # if the process is native, it takes longer time to init the services !!      
    
    simulator = NeuralModule('VivaeSimulator',g)  # create NeuralModule which is able to add/remove agents
    
    vivae = simulator.getControls();     # this starts the control services..
    vivae.setVisible(True);              # make simulation window visible..
    many=net.add(simulator)                 # add it to the Nengo network
    """
    vivae.loadMap('data/scenarios/test/walls.svg')  

    #addAgent(name,numSensors, maxDistance, frictionSensor) 
    vivae.addAgent('a',2*numsensors,    120          ,0)
    vivae.start()
    """
    print 'loaigin'
    vivae.loadMap(mn)  
    agentNames = ['a','b','c','d','e','f','g','h','i','j','k','l','m']
    # run as many agents as map can hold (up to a-m)  
    for i in range(0, len(agentNames)):
        vivae.addAgent(agentNames[i], numSensors, maxdist, frictdist)
    print 'starting'
    vivae.start()
    
    """
    vivae.loadMap(mn)  
    agentNames = ['a','b','c','d','e','f','g','h','i','j','k','l','m']
    # run as many agents as map can hold (up to a-m)  
    for i in range(0, len(agentNames)):
        Controls.addAgent(agentNames[i], numSensors, maxdist, frictdist)    
    """
    #    vivae.start()
    print 'Vivae is ready.'
开发者ID:jvitku,项目名称:nengo_1.4,代码行数:54,代码来源:vivae_orig.py

示例4: init

# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def init(net, mapName=Sim.Maps.DEFAULT, visible=False):
	
    # create group of nodes
    g = NodeGroup("vivae", True);               	# create default group of nodes
    g.addNode(server, "SimulatorServer", "java");   # run the simulator..
    g.addNode(modem,"modem","modem")              	# add default modem..
    g.startGroup()                              	# start group normally

    simulator = NeuralModule('VivaeSimulator',g)  	# create NeuralModule which is able to add/remove agents

    vivae = simulator.getControls();     			# this starts the control services..
    vivae.callSetVisibility(visible);              	# make simulation window visible..
    result=net.add(simulator)                 		# add it to the Nengo network

    vivae.callLoadMap(mapName)  					# loads the map into the simulator and waits for start or agents
    return simulator;
开发者ID:jvitku,项目名称:nengo_1.4,代码行数:18,代码来源:vivaeServer.py

示例5: initVivae

# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import startGroup [as 别名]
def initVivae(numsensors, visible=False):
    modem  = "ctu.nengoros.comm.nodeFactory.modem.impl.DefaultModem";   
    server = "vivae.ros.simulator.server.SimulatorServer"        		# start the simulator server in own thread

    # create group of nodes
    g = NodeGroup("vivae", True);               # create default group of nodes
    g.addNode(server, "SimulatorServer", "java");   # run the simulator..
    g.addNode(modem,"modem","modem")              # add default modem..
    g.startGroup()                              # start group normally

    simulator = NeuralModule('VivaeSimulator',g)  # create NeuralModule which is able to add/remove agents

    vivae = simulator.getControls();     # this starts the control services..
    vivae.callSetVisibility(visible);              # make simulation window visible..
    many=net.add(simulator)                 # add it to the Nengo network

    vivae.callLoadMap('data/scenarios/test/wallsII.svg')  

    #addAgent(name,numSensors, maxDistance, frictionSensor)  (note that you will actually get numSensors+1 floats +(speed))
    vivae.addAgent('a',2*numsensors,    120          ,0)
    vivae.callStartSimulation()
    return simulator;
开发者ID:jvitku,项目名称:vivae,代码行数:24,代码来源:02PIRegulator.py


注:本文中的ctu.nengoros.comm.nodeFactory.NodeGroup.startGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。