cognac.utils package

Submodules

cognac.utils.graph_utils module

cognac.utils.graph_utils.generate_coordination_graph(matrix)
cognac.utils.graph_utils.generate_dag_influence_matrix(n, p=1)

Generates a random Directed Acyclic Graph (DAG) with n nodes.

Parameters: - n (int): Number of nodes in the graph. - p (float): Probability of an edge existing between two nodes.

Returns: - np.ndarray: An n x n adjacency matrix representing the DAG.

cognac.utils.graph_utils.generate_deterministic_matrix(n, p=0.2, symmetry=False)
cognac.utils.graph_utils.generate_influence_matrix(n, gain=0.3, p=0.2, symmetry=False)
cognac.utils.graph_utils.plot_influence_graph(matrix)

cognac.utils.visualization module

class cognac.utils.visualization.GifRenderingWrapper(env, duration=0.3)

Bases: object

capture_frame()

Capture the current environment state as an image.

generate_gif(output_filename='trajectory.gif')

Save the captured frames as a GIF.

reset()

Reset environment and clear frames.

step(action_dict)

Perform a step and save the frame.

Module contents