Giter VIP home page Giter VIP logo

forestfiresimulation's Introduction

Forest Fire Simulation

This is a simple forest fire simulation in JAVA. The simulation is based on the following rules:

  • The simulation works by steps
  • A forest is composed of trees
  • Each tree can be in one of the following states: HEALTHY, BURNING, BURNED
  • Each burning tree can ignite its neighbors with a certain probability
  • If a tree is in the state BURNING, it will be in the state BURNED in the next step

Configuration

To configure the simulation, you can edit the config.json file located in the resources folder.

  • forestWidth & forestHeight are the number of trees in the forest in width and in height. (must be an Integer)
  • treeSize is the size of a tree in pixels. (must be an Integer)
  • fireProbability is the probality of a burning tree to ignite its neighbors. (must be a Double between 0 and 1)
  • burningTrees is a list of all the tree coordinates that will be burning at the first step. (must be a list of Coordinates Integers)

Features

  • You can ignite manually a tree at anytime by clicking on it.
  • The simulation works by steps, you can go to the next step by clicking on the Step button.
  • You can reset the simulation by clicking on the Reset button.

Potentials Improvements

  • Add a Play/Pause button.
  • Add a slider to control the speed of the simulation.
  • Add other types of cells like WATER or ROCK that can block the fire.

Dependencies

  • Java 17
  • json_simple-1.1.jar (included in the project)

forestfiresimulation's People

Contributors

clement-cardot 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.