Giter Club home page Giter Club logo

animal-farm's Introduction

Actions Status

animal-farm

An example simulating a farm of animals using design patterns.

Currently implementing the following design patterns:

  • Template
  • State

Already implemented

  • Instead of simulating a whole day in a method, break the method so that it simulates a single step and then returns. Each step could be an hour and the method could be called simulateStep.
  • Maybe use the State pattern for the simulatestep (that's something we did not see but it is not so difficult)

Ideas for expansion

  • Create other animals with different behaviour
  • Create the animals via an Abstract Factory
  • Having more than one animal in the farm...
  • Animals interacting?
  • Other creatures in the farm, ...
  • Other entities in the farm, ...

animal-farm's People

Contributors

dranidis avatar kubigr avatar mmichailidis avatar

Watchers

 avatar  avatar

Forkers

mmichailidis

animal-farm's Issues

Different executions with same random seed have different results.

FarmRandom is a Singleton factory providing the same Random instance to all classes.

FarmRandom.isFake=true, before the first getInstance makes sure that same random numbers are provided by initializing with seed 0: Random(0).

Tests show that this works, but different executions of the program have differences.

How to reproduce:

mvn clean install
java -cp target/classes com.asdt.farm.App > output1
java -cp target/classes com.asdt.farm.App > output2
diff output1 output2

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.