def weight(edge, modifiers):
    """
    Gets the modified weight of the edge.

    Args:
        edge (DirectedEdge): Edge to get weight from.
        modifiers (list): A list of objects that modify the edge weight.
            These objects must support get_multiplier(edge).
    """
    weight = edge.weight
    for modifier in modifiers:
        weight *= modifier.get_multiplier(edge)
    return weight