class Relationship: def __init__(self, character1, character2, relationship_type, strength): self.character1 = character1 self.character2 = character2 self.relationship_type = relationship_type self.strength = strength
return interaction_history
def build_relationship_graph(self): for relationship in self.relationships: self.G.add_edge(relationship.character1.name, relationship.character2.name, relationship_type=relationship.relationship_type, strength=relationship.strength)
class Storyline: def __init__(self, characters, relationships): self.characters = characters self.relationships = relationships self.G = nx.Graph()
