GithubHelp home page GithubHelp logo

pianocode / a-life-simulation Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 290 KB

Project to simulate the daily activities of people. Using threading and memory management principles

CMake 4.60% C++ 95.40%

a-life-simulation's Introduction

A Life Simulation

NOTE: This is my Capstone project in the Udacity C++ Nanodegree Program.

In this project, I've built from scratch a system that logs the daily activities of one or multiple people, that is up to the user. This choice was influenced by the desire of putting into practice, what I learned about smart pointers and concurrency in C++. When you run the programs you will be asked how many people you want to participate in the simulation, then you will see how each person does a sequence activities. There are few activities, and each of them cannot be done by more than one person at the same time. That is where concurrency will handle all the activity threads accepting people requests and move them around other activities. The program running looks like this:

Program running in terminal

The program shows in the standard output:

  • which activity is being performed, and the person ID doing the activity
  • the number of times each user does every activity An additional thread makes the program to run for about 60 seconds. This can be tweaked in function setTimer() within src/main.cpp.

If you want more details about the internals of the program, check explanation.md

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory in the top level directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./ALifeSimulation.

a-life-simulation's People

Contributors

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