Class Story

java.lang.Object
org.episteme.social.philosophy.storytelling.Story
All Implemented Interfaces:
Serializable, Graph<Event>, Commented, ComprehensiveIdentification, Identified<Identification>, Named

public class Story extends Object implements Graph<Event>, ComprehensiveIdentification
A class representing a continuous and logical flow of events as a graph G = (V, E). This structure stores narrative scripts where events are vertices and causal/timed links are edges. Modernized to implement ComprehensiveIdentification and support dynamic traits and consistent identity.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Story

      public Story()
      Creates a new Story graph with a generated ID.
    • Story

      public Story(Identification id)
      Creates a new Story graph with a specific ID.
  • Method Details

    • getId

      public Identification getId()
      Description copied from interface: Identified
      Returns the unique identifier of this entity.
      Specified by:
      getId in interface Identified<Identification>
      Returns:
      the identifier
    • getTraits

      public Map<String,Object> getTraits()
      Description copied from interface: ComprehensiveIdentification
      Returns the traits map for this entity.
      Specified by:
      getTraits in interface Commented
      Specified by:
      getTraits in interface ComprehensiveIdentification
      Returns:
      the traits map
    • vertices

      public Set<Event> vertices()
      Description copied from interface: Graph
      Returns all vertices in this graph.
      Specified by:
      vertices in interface Graph<Event>
      Returns:
      unmodifiable set of vertices
    • edges

      public Set<Graph.Edge<Event>> edges()
      Description copied from interface: Graph
      Returns all edges in this graph.
      Specified by:
      edges in interface Graph<Event>
      Returns:
      unmodifiable set of edges
    • vertexCount

      public int vertexCount()
      Description copied from interface: Graph
      Returns the number of vertices in the graph.
      Specified by:
      vertexCount in interface Graph<Event>
      Returns:
      the number of vertices
    • addVertex

      public boolean addVertex(Event event)
      Description copied from interface: Graph
      Adds a vertex to the graph.
      Specified by:
      addVertex in interface Graph<Event>
      Parameters:
      event - the vertex to add
      Returns:
      true if vertex was added, false if already present
    • addEdge

      public boolean addEdge(Event source, Event target)
      Description copied from interface: Graph
      Adds an edge between two vertices.
      Specified by:
      addEdge in interface Graph<Event>
      Parameters:
      source - the source vertex
      target - the target vertex
      Returns:
      true if edge was added
    • neighbors

      public Set<Event> neighbors(Event event)
      Description copied from interface: Graph
      Returns neighbors of a vertex.
      Specified by:
      neighbors in interface Graph<Event>
      Parameters:
      event - the vertex
      Returns:
      set of adjacent vertices
    • degree

      public int degree(Event event)
      Description copied from interface: Graph
      Returns the degree (number of edges) of a vertex.
      Specified by:
      degree in interface Graph<Event>
      Parameters:
      event - the vertex
      Returns:
      degree of vertex
    • isDirected

      public boolean isDirected()
      Description copied from interface: Graph
      Checks if this graph is directed.
      Specified by:
      isDirected in interface Graph<Event>
      Returns:
      true if directed, false if undirected
    • addEvent

      public void addEvent(Event event)
      Adds an event to the story.
      Parameters:
      event - the event to add
    • solve

      public Set<Event> solve(Event question)
      Infers new events based on causal links starting from a specific event. Logic adapted to the Graph structure.
      Parameters:
      question - the starting event
      Returns:
      set of reachable events
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object