Class Activity

java.lang.Object
org.episteme.social.psychology.Activity
All Implemented Interfaces:
Serializable, Commented, Named

public class Activity extends Object implements Named, Commented, Serializable
Represents a structured activity composed of nested sub-activities or atomic behaviors. Activities help organize behaviors into goal-oriented sequences for individuals or roles. * @version 1.7
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Activity

      public Activity(String name)
      Creates a new Activity with the specified name.
      Parameters:
      name - the name of the activity
      Throws:
      IllegalArgumentException - if name is null or empty
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface Named
    • getComments

      public String getComments()
      Description copied from interface: Commented
      Returns the comments associated with this object. Maps to a "comments" trait.
      Specified by:
      getComments in interface Commented
      Returns:
      the comments
    • setComments

      public void setComments(String comments)
      Description copied from interface: Commented
      Sets the comments for this object. Maps to a "comments" trait.
      Specified by:
      setComments in interface Commented
      Parameters:
      comments - the comments to set
    • getTraits

      public Map<String,Object> getTraits()
      Description copied from interface: Commented
      Returns the map of traits/attributes for this object. Implementations should provide a mutable map to support default methods.
      Specified by:
      getTraits in interface Commented
      Returns:
      the traits map
    • getGoal

      public String getGoal()
      Returns the goal of the activity.
      Returns:
      the goal description
    • setGoal

      public void setGoal(String goal)
      Sets the goal description for this activity.
      Parameters:
      goal - the new goal
      Throws:
      NullPointerException - if goal is null
    • getSubActivities

      public List<Activity> getSubActivities()
      Returns the list of sub-activities.
      Returns:
      the sub-activities list
    • addSubActivity

      public void addSubActivity(Activity activity)
      Adds a sub-activity to this activity.
      Parameters:
      activity - the activity to add
      Throws:
      IllegalArgumentException - if this activity already has atomic behaviors
      NullPointerException - if activity is null
    • removeSubActivity

      public void removeSubActivity(Activity activity)
      Removes a sub-activity from this activity.
      Parameters:
      activity - the activity to remove
      Throws:
      NullPointerException - if activity is null
    • setSubActivities

      public void setSubActivities(List<Activity> activities)
      Sets the sub-activities list.
      Parameters:
      activities - the list of activities
      Throws:
      IllegalArgumentException - if this activity already has atomic behaviors
      NullPointerException - if activities is null
    • getBehaviors

      public Set<Behavior> getBehaviors()
      Returns the set of atomic behaviors associated with this activity.
      Returns:
      the behaviors set
    • setBehaviors

      public void setBehaviors(Set<Behavior> behaviors)
      Sets the atomic behaviors for this activity.
      Parameters:
      behaviors - the set of behaviors
      Throws:
      IllegalArgumentException - if this activity already has sub-activities