Package

com.generativists.thirdway

core

Permalink

package core

Visibility
  1. Public
  2. All

Type Members

  1. trait Activity[Env] extends Serializable

    Permalink
  2. case class Event[Env](time: Double, group: Int, activity: Activity[Env]) extends Ordered[Event[Env]] with Serializable with Product

    Permalink

    Defines an activity to run at a specific, scheduled time and group.

  3. case class LocallyParallelActivity[Env](activities: Seq[Activity[Env]]) extends Activity[Env] with Product with Serializable

    Permalink

    Runs a set of activities in parallel using Scala's parallel collections.

    Runs a set of activities in parallel using Scala's parallel collections.

    Note

    Building simulations with truly-concurrent agents is *really* hard. As a design assumption, ThirdWay considers thread-based, parallel simulations to be a bad idea. However, there are situations that demand true concurrency. For example, the cognitive component of thick agents may be embarrassingly parallel. Rather than using synchronized-based locking, schedule the heavy operation separately. For example, create an activity that calls some agent's think() method. This method should do no environmental or schedule mutation. Then, schedule it repeatedly, with an ordering that comes after mutating and interacting activities.

  4. class NoOp[Env] extends Activity[Env]

    Permalink

    Does nothing.

    Does nothing. Useful for testing

  5. case class RepeatingActivity[Env](activity: Activity[Env], interval: Double, group: Int, stopped: Boolean = false) extends Stoppable[Env] with Product with Serializable

    Permalink

    An activity that reschedules itself indefinitely, at a fixed interval.

    An activity that reschedules itself indefinitely, at a fixed interval.

    See also

    the implementation note in TentativeActivity

  6. class Schedule[Env] extends Clearable with Serializable

    Permalink
  7. case class SequencedActivities[Env](activities: Seq[Activity[Env]]) extends Activity[Env] with Product with Serializable

    Permalink

    Runs a sequence of activities in a fixed order.

  8. case class ShuffledActivities[Env](activities: Seq[Activity[Env]]) extends Activity[Env] with Product with Serializable

    Permalink

    Runs a set of activities in randomized order.

  9. trait Stoppable[Env] extends Activity[Env]

    Permalink
  10. case class TentativeActivity[Env](activity: Activity[Env], stopped: Boolean = false) extends Stoppable[Env] with Product with Serializable

    Permalink

    An Activity that will run once, but only if it has not been stop()ed.

    An Activity that will run once, but only if it has not been stop()ed.

    Note

    The initial implementation used had activity: Option[Activity]. Calling stop set this field to None. It felt like proper Scala. However, it also allows for substitution of an activity, which is wrong. An immutable activity is better.

    ,

    Calling stop does not remove the TentativeActivity from the schedule. Instead, once dequeued, it simply fails to take any action on apply(env, schedule).

Value Members

  1. object Implicits

    Permalink
  2. object Schedule extends Serializable

    Permalink
  3. object Util

    Permalink

Ungrouped