logo

CULEBRA.JAVA

Gallery details

Culebra_processing_COVERCMP

CULEBRA LIBRARY FOR PROCESSING INTRODUCTION

A collection of objects and behaviors for creating dynamic multi agent interactions.
2D|3D Multi Object Behavior library focused on hybrid system interactions with custom Visualization, Data, and performance features.

WAYS TO USE CULEBRA

  • Use the Culebra Objects and Controller (Recommended) Demo Files
  • Create your own objects and simply implement behavior classes individually. See File
  • Create your own objects and inherit from Culebra Objects. This will provide access to the controller and all classes. See File

CULEBRA.OBJECTS

There are currently 5 types of objects you can inherit from or implement their default attributes.

  • Object – Abstract class from which other objects can inherit from. Both Creepers & Seekers extend this class. This class also has the instances of the controller and vizualization classes required to run these objects. This class declares the basic abstract methods which must be implemented by any class which derrives from it.
  • Creeper – Creeper Objects are the main implementation of the abstract Objects. They are able to implement any type of behavior and are meant as a do all type of object.
  • Seekers – Seeker Objects are the technically also main implementation of the abstract Objects, like Creeper Objects, they poses the same capabilities. They are able to implement any type of behavior but are meant to be used as Objects which “Seek” other objects. They should be used in conjunction with behaviors.trailFollowing Methods. I have not restricted their behavior implementations at this stage but might do so in the future to make certain behaviors more Object type specific.
  • BabyCreeper – Baby Creeper class which inherits from the Creeper Class – Object is meant to be used as a child of the Creeper Object
  • BabySeeker – Baby Seeker class which inherits from the Seeker Class – Object is meant to be used as a child of the Seeker Object

Polymorphism

  • The Culebra objects have been set up to take advantage of Polymorphism, which is the ability for an object of one type to be treated as though it were another type. In Java, inheritance provides us one kind of polymorphism. An object of a subclass can be treated as though it were an object of its parent class, or any of its ancestor classes. Any Java object that can pass more than one IS-A test is considered to be polymorphic.

Composition & Inheritance Relationships

  • Culebra’s Abstract Object ,Controller & Viz Classes are strongly associated and form a Composition. The composition or HAS-A relationship means an instance of one class “has a” reference to an instance of another class or another instance of same class. So our Culebra Object “has a” reference to the Controller and Viz classes which are key.
  • Creepers & Seekers have a IS-A relationship to the culebra Object Abstract Class. IS-A relationships are totally based on inheritance.
  • BabySeekers & BabyCreepers have a IS-A relationship with Creeper & Seeker Objects respectively.

For more information see the CustomObject_Polymorphism_III example

CONTROLLER

  • Controller Class – this is the class which acts as controller for all behaviors classes. This class also builds on behaviors, using image drivers and other features which are not in the stock behavior classes. The Abstract Object class mentioned below contains and instance of this class (controller contains instance of all behaviors), and since all other objects derrive from this class the controller is there to provide a global controlling mechanism. See Class Diagram for more details.

BEHAVIORS

There are 7 Major Types of Behaviors which can be hybridized anyway your heart desires

  • Flocking Behavior – Flockers Behavior Type Class Implements Flock Behavior Interface.
  • Wandering Behavior – Wanderer Behavior Type Class Implements Wander Behavior Interface, the base Wander behavior is from Craig Reynolds and Daniel Shiffman.
  • Noise Behavior – Improved Perlin Noise Behavior Type Class Implements Noise Behavior Interface.
  • Tracking Behavior – Path, Shape and multiShape Tracker Behavior Type Class Implements Tracking Behavior Interface.
  • BabyMakers Behavior – Objects can spawn children under the right conditions. Objects can have type specific behaviors. For example, if you are a “Parent” object or object of type Creeper or Seeker or you derrive from these classes then you can create children, however if you are of type BabyX then you no longer have the capability to spawn children.
  • Mesh Crawler – Mesh Crawler Behavior Class.
  • Forces – Attract, Repel and other force methods inside the controller class.

VIDEOS

RELEASES

Culebra 1.0 – Requires Processing 3.1.1

For more specific details see the Class Diagram Below

CLASS DIAGRAM
Culebra_ClassDiagram

CREDITS

  • Obviously thanks to Craig Reynolds for all of his work on boids behavior.
  • Big thanks to Daniel Shiffman, his work has been very inspirational and referenced in this library.
  • Share

Leave a reply

Your email address will not be published. Required fields are marked *