Giter VIP home page Giter VIP logo

cellularautomatonpopulation's Introduction

Generations


config:

(see config.txt)

    Num of Factions -> 1 to 8
    fac1 -> Color, (minStr, maxStr) (minRepr, maxRepr) (x, y)
    ...
    facN -> Color (minStr, maxStr) (minRepr, maxRepr) (x, y)
    mutation -> (-1.0, 1.0)
    mutationChance -> 0.0 to 1.0
    disease -> 1:YES | 0:NO

Rules:

  • Each cell has the following:

    • Age
    • Strength
    • Reproduction Value
    • Faction Color
    • Sick (T/F)
  • Place FACTIONS across Map

  • Simulation Begins

    • Each Turn:
      • Age increases
      • Reproduction Ticker decreases
      • Cell can either move N, NE, E, SE, S SW, W or NW
        • If theres water, cell stays put.
      • If Reproduction Ticker == 0
        • Reproduction Ticker resets to Reproduction Value
        • Cell reproduces
          • Child inherits parents Strength and Reproduction Value
      • Each Move, Cell has a 10% chance of developing a disease, if cell is sick and reproduces child has 50% chance of being born sick.
        • If cell is sick each move it has a 10% chance of recovering
        • Disease cuts cells strength by 1/3

To-Do:

  • Add mutations
  • Add Disease
    • Each move, Cell has a 10% chance of developing a disease, if cell is sick and reproduces child has 50% chance of being born sick. If cell is sick each move it has a 10% chance of recovering~~~~Disease cuts cells strength by 1/3 (could be modified by config file)
  • Add Zoom in/Zoom out functionality to map
  • Cell battles
  • Placeable factions with mouse
  • Water Travel
  • Faction Legend

Colors:

RED = (255,0,0)
BLUE = (0,0,255)
GREEN = (0,255,0)
YELLOW = (255,255,0)
MAGENTA = (255,0,255)
CYAN = (0,255,255)
ORANGE = (255,165,0)
PURPLE = (128,0,128)
WHITE = (255,255,255)
BLACK = (0,0,0)


Throwaway
for faction in self.factions:
        for cell in faction.cells:

            if cell.alive:
                pygame.draw.rect(win, cell.color, (cell.x, cell.y, cell.size, cell.size) )	
        
                cell.move(map, win)

                if cell.counter == 0:
                    faction.reproduce(cell, self.mutationRange, self.mutationChance)
                    cell.counter = cell.reproTick
            else:
                faction.cells.remove(cell)

cellularautomatonpopulation's People

Contributors

rafmillan avatar

Watchers

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