Giter VIP home page Giter VIP logo

oop-lab-4's Introduction

OOP-Lab-4

World simulation!

Main entities:

  • Humans:Can reproduce, the more humans -> more reproduction
    Can kill each other in wars, the bigger the "evilness" attribute of the humans the more they kill each other
    Can produce food and consume it when soil fertility = 0, if there is no food produced all the humans die
    Have an impact on the environment, the more humans -> the faster the world temperature increases (global warming), this also decreases the world humidity
    Can make the world's soil more fertile
    Die when the water amount of the world = 100% or 0%
    Have a set of world requirements that the world needs to adhere to for them to live

  • Sharks: Slow reproduction
    Can kill each other but do so less often than humans
    Die when the water amount of the world = 0%
    Have a set of world requirements that the world needs to adhere to for them to live

  • Rats : The fastest reproduction
    Can kill each other but do so rarely (less often than sharks/humans)
    By eating crops they decrease the soil fertility
    Die when the water amount of the world = 100% or 0%
    Have a set of world requirements that the world needs to adhere to for them to live

  • Weapons : Produced by humans, the more humans->the bigger the weapon amount
    Is used by humans in their "wars", the more weapons->the more they kill each other
    Have a destruction level, just one weapon with a high enough destruction level can eliminate the entire human population!

  • Tsunami's : Have a destruction level and a duration
    The bigger the destruction level and duration -> the more they increase the total water amount in the world and the world humidity
    Each year they have a chance of 1/12 of happening

  • Earthquake's : Have a destruction level and a duration
    The bigger the destruction level and duration -> the more they decrease fertility of the world's soil and increase the world's temperature
    Each year they have a chance of 1/12 of happening
    Just like in real life, earthquakes have a chance of producting tsunami's. So after an earthquake the probability of a tsunami happening immediately after it decreases from 1/12 to 1/8

    Polymorphism can be seen in the following: the classes Humans, Sharks and Rats all override certain methods from the abstract class Organisms. We can also see method overloading in the classes Natural Calamities, Earthquakes and Tsunami's.
    Further information can be seen in this image of the simulation hierarchy Screenshot from 2022-10-17 21-24-42

oop-lab-4's People

Contributors

mariusbotezatuu 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.