Genome

Genome is the a class that encapsulates a representation of a GAIuS agent topology. This class keeps track of primitive nodes, manipulative nodes, and provides a mechanism for visualizing a topology. Automatically created by AgentClient when connecting to a GAIuS agent.

class ia.gaius.genome_info.Genome(topology: dict)

Bases: object

Wrapper class for a Genome topology, loaded from a dict

Variables:
  • topology – the data representing a Genome

  • agent – agent data parsed from topology

  • description – Genome description field

  • primitive_map – dict of “node name” to “node id” pairings

__init__(topology: dict)

Initialize a genome from a GAIuS agent topology (dict)

Parameters:

topology (dict, required) – GAIuS agent topology

change_genes(p_id, gene_data)

Change the genes of a primitive in the Genome’s cache

Parameters:
  • p_id (str) – primitive id of the node to edit

  • gene_data (dict) – dictionary of genes to update in the Genome’s cache

display()

Display the Genome topology in Cytoscape

get_manipulative_map()

Get a map of the manipulatives connected to each primitive node in the GAIuS agent topology

Returns:

dictionary of manipulatives mappings in the topology

Return type:

dict

get_nodes()

Return a tuple of primitive node names, manipulative node names from the topology

get_primitive_map()

Get a map of node names to primitive ids in the GAIuS agent topology

Example

>>> agent = AgentClient(agent_info)
>>> agent.connect()
>>> agent.genome.get_primitive_map()
{'P1': 'p46b6b076c'}