Giter VIP home page Giter VIP logo

the-sea's Introduction

TheSea

This is a java applet that simulates the schooling behavior of fish. It is based on Daniel Schiffman's processing implementation of the classic boids algorithm (Craig Reynolds, 1986), ported to Java. There are two branches. The first simulates schooling as described above. The second implements a genetic algorithm to evolve the schooling behavior based on avoidance of a predator. See a description of both below.

master-clean

This branch holds a standard schooling simulation.

A number of changes have been implemented to expand the basic flocking functionality. The Fish class has been extended into two child classes, Guppy and Predator. The guppies will school together based on three basic steering forces of alignment, cohesion, and separation. They also try to avoid any and all predator objects. The predator attempts to catch guppies.

There are a few variables that can be altered to influence the behavior of the program:

  • popSize: initial population of the school
  • pullDist: maximum distance (in pixels) that individual fish will be aware of each other
  • desiredSep: distance (in pixels) that fish want to have between each other
  • scareDist: distance (in pixels) that fish will notice a predator and steer away
  • sniffDist: distance (in pixels) that a predator will notice a fish and steer towards
  • aC: alignment coefficient, the degree to which fish want to align their vectors
  • cC: cohesion coefficient, the degree to which fish want to move toward the center of mass
  • sC: separation coefficient, the degree to which fish maintain their personal space
  • fC: flight coefficient, the degree to which fish will want flee a predator

master

This branch is a genetic algorithm implementation. The School class has been expanded into the Population class, and a DNA class has been added. The variables described in master-clean have been implemented as the genes that make up any given guppy's DNA. They begin as random, and the fish that perform better in each generation have a higher chance of passing their genes on to the next generation.

Performance is graded based on avoidance of the predator and conformance to standard schooling behavior as implemented in master-clean.

the-sea's People

Contributors

jskrable avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.