Dummy Nodes
Here you can find a description of all the scripts that implement simplified versions of some cognitive nodes. The idea is to have cognitive nodes as barebones as possible to run experiments where we only want to focus on a specific cognitive node variation / algorithm.
Dummy nodes
Python scripts for the implementation of dummy nodes. The dummy nodes avaliable are:
Drive
- class dummy_nodes.dummy_drive.DriveDummy(*args: Any, **kwargs: Any)[source]
Bases:
DriveDrive which evaluation is always 1.0.
- evaluate(perception=None)[source]
Get expected valuation for a given perception. In this case, the evaluation is always 1.0.
- Parameters:
perception (dict) – The given normalized perception. Not used in this case.
- Returns:
Evaluation msg with the evaluation value and the timestamp.
- Return type:
cognitive_node_interfaces.msg.Evaluation
Goal
- class dummy_nodes.dummy_goal.GoalDummy(*args: Any, **kwargs: Any)[source]
Bases:
GoalMotivenDummy Goal class: A goal that is never rewarded.
P-Node
- class dummy_nodes.dummy_pnodes.ActivatedDummyPNode(*args: Any, **kwargs: Any)[source]
Bases:
DummyPNodeActivated Dummy PNode class
- calculate_activation(perception=None, activation_list=None)[source]
Always returns an activation of 1.0
- Parameters:
perception (dict) – The perception for which P-Node activation is calculated. It is not used in this case.
activation_list (list) – The list of activations to be used for the calculation. It is not used in this case.
- Returns:
A msg with the activation of the P-Node and its timestamp.
- Return type:
cognitive_node_interfaces.msg.Activation
- class dummy_nodes.dummy_pnodes.DummyPNode(*args: Any, **kwargs: Any)[source]
Bases:
PNodeActivated Dummy PNode class
- calculate_activation(perception=None, activation_list=None)[source]
Activation value for the dummy P-Nodes. This method has to be implemented in a subclass.
- Parameters:
perception (dict) – The perception for which P-Node activation is calculated.
activation_list (list) – The list of activations to be used for the calculation.
- Raises:
NotImplementedError – If the method is not implemented in a subclass.
- send_pnode_space_callback(request, response)[source]
Callback that sends the space of the P-Node.
- Parameters:
request (cognitive_node_interfaces.srv.SendGoalSpace.Request) – Empty request.
response (cognitive_node_interfaces.srv.SendGoalSpace.Response) – Response that contains the space of the P-Node. In this case it is empty.
- Returns:
Response that contains the space of the P-Node. In this case it is empty.
- Return type:
cognitive_node_interfaces.srv.SendGoalSpace.Response
- class dummy_nodes.dummy_pnodes.NonActivatedDummyPNode(*args: Any, **kwargs: Any)[source]
Bases:
DummyPNodeActivated Dummy PNode class
- calculate_activation(perception=None, activation_list=None)[source]
Always returns an activation of 0.0
- Parameters:
perception (dict) – The perception for which P-Node activation is calculated. It is not used in this case.
activation_list (list) – The list of activations to be used for the calculation. It is not used in this case.
- Returns:
A msg with the activation of the P-Node and its timestamp.
- Return type:
cognitive_node_interfaces.msg.Activation
- class dummy_nodes.dummy_pnodes.RandomDummyPNode(*args: Any, **kwargs: Any)[source]
Bases:
DummyPNodeRandom Dummy PNode class
- calculate_activation(perception=None, activation_list=None)[source]
Return a random activation
- Parameters:
perception (dict) – The perception for which P-Node activation is calculated. It is not used in this case.
activation_list (list) – The list of activations to be used for the calculation. It is not used in this case.
- Returns:
A msg with the activation of the P-Node and its timestamp.
- Return type:
cognitive_node_interfaces.msg.Activation