本文整理汇总了Python中ctu.nengoros.comm.nodeFactory.NodeGroup.addNode方法的典型用法代码示例。如果您正苦于以下问题:Python NodeGroup.addNode方法的具体用法?Python NodeGroup.addNode怎么用?Python NodeGroup.addNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctu.nengoros.comm.nodeFactory.NodeGroup
的用法示例。
在下文中一共展示了NodeGroup.addNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: not_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def not_node(name):
g = NodeGroup("NOT", True);
g.addNode(NOT, "NOT", "java");
module = NeuralModule(name+'_NOT', g)
module.createEncoder("logic/gates/ina", "bool", 1)
module.createDecoder("logic/gates/outa", "bool", 1)
return module
示例2: initVivae
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [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;
示例3: fuzzynot_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def fuzzynot_node(name):
g = NodeGroup("FuzzyNOT", True);
g.addNode(fNOT, "FuzzyNOT", "java");
module = NeuralModule(name+'_FuzzyNOT', g)
module.createEncoder("logic/gates/ina", "float", 1)
module.createDecoder("logic/gates/outa", "float", 1)
return module
示例4: async_timeaware_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def async_timeaware_node(name):
g = NodeGroup("AsynTimeAwareNode", True);
g.addNode(time, "AsynTimeAwareNode", "java");
module = NeuralModule(name+'_AsynTimeAwareNode', g, False)
module.createEncoder("org/hanns/demonodes/pubsub/IN", "float", 4)
module.createDecoder("org/hanns/demonodes/pubsub/OUT", "float", 2)
return module
示例5: initVivae
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [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;
示例6: sync_timeaware_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def sync_timeaware_node(name):
g = NodeGroup("SynMinMaxFloat", True);
g.addNode(time, "SynMinMaxFloat", "java");
module = NeuralModule(name+'_SynMinMaxFloat', g)
module.createEncoder("org/hanns/demonodes/pubsub/IN", "float", 4)
module.createDecoder("org/hanns/demonodes/pubsub/OUT", "float", 2)
return module
示例7: async_minmaxfloat_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def async_minmaxfloat_node(name):
g = NodeGroup("AsynMinMaxFloat", True);
g.addNode(mmf, "AsynMinMaxFloat", "java");
module = NeuralModule(name+'_AsynMinMaxFloat', g, False)
module.createEncoder("org/hanns/demonodes/pubsub/IN", "float", 4)
module.createDecoder("org/hanns/demonodes/pubsub/OUT", "float", 2)
return module
示例8: sync_minmaxfloat_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def sync_minmaxfloat_node(name):
g = NodeGroup("SynMinMaxFloat", True);
g.addNode(mmf, "SynMinMaxFloat", "java");
module = NeuralModule(name+'_SynMinMaxFloat', g) # here: Nengo waits each step for response from node
module.createEncoder("org/hanns/demonodes/pubsub/IN", "float", 4)
neuron.createDecoder("org/hanns/demonodes/pubsub/OUT", "float", 2) # add FLOAT publisher
return module
示例9: sync_minmaxint_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def sync_minmaxint_node(name):
g = NodeGroup("SynMinMaxInt", True);
g.addNode(minmaxint, "SynMinMaxInt", "java");
module = NeuralModule(name+'_SynMinMaxInt', g) # here: Nengo waits each step for response from node
module.createEncoder("org/hanns/demonodes/pubsub/IN", "float", 4)
module.createDecoder("org/hanns/demonodes/pubsub/OUT", "int", 2)
return module
示例10: nand_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def nand_node(name):
g = NodeGroup("NAND", True);
g.addNode(NAND, "NAND", "java");
module = NeuralModule(name+'_NAND', g)
module.createEncoder("logic/gates/ina", "bool", 1)
module.createEncoder("logic/gates/inb", "bool", 1)
module.createDecoder("logic/gates/outa", "bool", 1)
return module
示例11: or_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def or_node(name):
g = NodeGroup("OR", True);
g.addNode(OR, "OR", "java");
module = NeuralModule(name+'_OR', g)
module.createEncoder("logic/gates/ina", "bool", 1)
module.createEncoder("logic/gates/inb", "bool", 1)
module.createDecoder("logic/gates/outa", "bool", 1)
return module
示例12: fuzzyand_node
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def fuzzyand_node(name):
g = NodeGroup("FuzzyAND", True);
g.addNode(fAND, "FuzzyAND", "java");
module = NeuralModule(name+'_FuzzyAND', g)
module.createEncoder("logic/gates/ina", "float", 1)
module.createEncoder("logic/gates/inb", "float", 1)
module.createDecoder("logic/gates/outa", "float", 1)
return module
示例13: fuzzyMemIncLin
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def fuzzyMemIncLin(name): # ____|----
g = NodeGroup("FuzzyMemIncLin", True);
g.addNode(flininc,"FuzzyMemIncLin","java");
module = NeuralModule(name+'_FuzzyMemIncLin', g)
module.createEncoder("logic/gates/ina", "float", 1) # x
module.createEncoder("logic/gates/confa", "float", 1) # alpha
module.createEncoder("logic/gates/confb", "float", 1) # beta
module.createDecoder("logic/gates/outa", "float", 1) # y
return module
示例14: make
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def make(net,name='NeuralModule which interfaces demoSubscriber with the Nengo simulator', independent=True, useQuick=True):
node = "org.hanns.demonodes.pubsub.DemoSubscriber";
g = NodeGroup(name, independent); # Create group of nodes (represented as SimpleNode in the GUI)
g.addNode(node, "subscriber", "java"); # start java node and name it subscriber in the ROS network
module = NeuralModule('Subscriber_'+name, g, False) # Construct the neural module in the asynchronous mode
module.createEncoder("org/hanns/demonodes/pubsub", "float", 7) # Define IO: termination = input of neuron (n*int)
many=net.add(module) # add it into Nengo simulator
示例15: fuzzyMemTriangle
# 需要导入模块: from ctu.nengoros.comm.nodeFactory import NodeGroup [as 别名]
# 或者: from ctu.nengoros.comm.nodeFactory.NodeGroup import addNode [as 别名]
def fuzzyMemTriangle(name): # ____|\____
g = NodeGroup("FuzzyMemTriangle", True);
g.addNode(ftriangle,"FuzzyMemTriangle","java");
module = NeuralModule(name+'_FuzzyMemTriangle', g)
module.createEncoder("logic/gates/ina", "float", 1) # x
module.createEncoder("logic/gates/confa", "float", 1) # alpha
module.createEncoder("logic/gates/confb", "float", 1) # beta
module.createEncoder("logic/gates/confc", "float", 1) # gamma
module.createDecoder("logic/gates/outa", "float", 1) # y
return module