def random_walk(network):
latest = network.latest_transmission_recipient()<EOL>if not network.transmissions() or latest is None:<EOL><INDENT>sender = random.choice(network.nodes(type=Source))<EOL><DEDENT>else:<EOL><INDENT>sender = latest<EOL><DEDENT>receiver = random.choice(sender.neighbors(direction="<STR_LIT:to>", type=Agent))<EOL>sender.transmit(to_whom=receiver)<EOL>
Take a random walk from a source.

    Start at a node randomly selected from those that receive input from a
    source. At each step, transmit to a randomly-selected downstream node.