logic_sim v0.1.4 LogicSim.Node.And View Source
Simple and
logic gate. Two inputs, output is true if both inputs are true, false otherwise.
Link to this section Summary
Functions
Callback implementation for LogicSim.Node.calculate_outputs/2
.
Returns state of server.
Links this nodes output to the input of another node.
Tells this node to set its input to the given value
Starts the node with the given options
Same as start_link/1
but raises on error.
Link to this section Functions
calculate_outputs(state, input_values) View Source
Callback implementation for LogicSim.Node.calculate_outputs/2
.
get_state(server) View Source
Returns state of server.
Also can be called from LogicSim.Node.get_state
if you don't know the node type.
link_output_to_node(output_node, output, input_node, input) View Source
Links this nodes output to the input of another node.
Takes the output node, the output to attach from, the node to attach to, and the node's input to attach to.
set_node_input(node, input, input_value) View Source
Tells this node to set its input to the given value
Will be called by another node when its output is changed while linked to this input.
start_link(opts \\ []) View Source
Starts the node with the given options
Possible Options:
listeners: a list of process pids that should be notified whenever the state of the node
changes. Listener will receive {:logic_sim_node_state, this_nodes_pid, this_nodes_state}
start_link!(opts \\ []) View Source
Same as start_link/1
but raises on error.