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.

def random_walk(network):
    """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.
    """
    latest = network.latest_transmission_recipient()

    if (not network.transmissions() or latest is None):
        sender = random.choice(network.nodes(type=Source))
    else:
        sender = latest

    receiver = random.choice(sender.neighbors(direction="to", type=Agent))

    sender.transmit(to_whom=receiver)