All Questions
Tagged with simulation java
58
questions
1
vote
1
answer
195
views
Simulating a toilet seat usage in Java - follow-up
(See the previous iteration.)
This time, I removed the stuff I don't need in my demo runner. Also, I consolidated some code that seemed DRY to me.
Simulation rules
When a female arrives, she ensures ...
2
votes
2
answers
124
views
Simulating a toilet seat usage in Java
(See also the next iteration.)
I have this small simulation program simulating a toilet seat. The toilet seat may be in two positions: up or down. If a male arrives to the toilet to urinate, and ...
4
votes
2
answers
1k
views
Traffic simulation GUI: an exercise in concurrent programming using threads
To avoid a code dump I have removed most of the code and left the first few lines of constructors and methods and anything relevant. Full code at the bottom.
The purpose of this code is to use threads ...
1
vote
4
answers
329
views
Given the arrival times of people at a door, resolve their passage times
I was trying to solve the following question:
You are given 2 arrays: one representing the time people arrive at a door and other representing the direction they want to go (in or out) You have to ...
5
votes
2
answers
301
views
A type of game simulation dropping disks
Quincunx is that little game where you drop a ball or disk down rows of nails in a pyramid formation until they land in a slot. This was a project for my class, but it's already been submitted. I am ...
6
votes
2
answers
5k
views
Fast Food Order Simulator
I have been trying learn OOP lately, and have made a simple program that simulates some sort of drive thru experience using a 9 digit keypad to add, delete, and pay for items ordered from the menu.
...
2
votes
1
answer
124
views
Code which creates the Game Of life In Java
Link to github
Link to github: https://github.com/zombi3123/Game-Of-Life/
Source code:
Window.Java
...
4
votes
3
answers
213
views
Simulation of forest growth and pruning
I was wondering how I could streamline the following code. This was the project assigned to us:
The Canadian Forest Service wants to do a simple simulation of the growth and pruning of forests. ...
2
votes
1
answer
150
views
Incrementing time in a discrete-event simulation of a supermarket queue
A method has been written that increments time in minutes that simulates how much time it takes to process item in a supermarket queue and if there is an empty queue, skip it and loops around to find ...
4
votes
2
answers
287
views
Follow up Implementation on Monty Hall Simulation
I have taken your inputs on my original question and formed a new implementation of the Monty Hall Simulation:
Again keep an eye on CleanCode and OOP
The Price to be won:
...
1
vote
1
answer
308
views
Counting results of die rolls
The algorithm bellow is meant to allow a user to roll a die as many times as he would like, then print how many times each side was rolled and how many rolls there were total.
...
3
votes
2
answers
2k
views
Extending Combo from Food in FoodOrder Simulator
This is an assignment and I'm trying to improve upon the design factor. Honestly the task seems very trivial to use inheritance so I kind of did it for the sake of doing it. The problem description ...
7
votes
3
answers
7k
views
Discrete Event Simulator
I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview.
I have wrote my ...
3
votes
1
answer
558
views
Classic Hundred Doors Simulation
I am doing the 100 Doors problem as an exercise to practice user input and loops. I do understand the problem can be solved by outputting every square number up to the maximum number, but it defeats ...
4
votes
2
answers
2k
views
Java Conway's Game Game of Life
I have implemented Conway's Game of Life simulation. What can I improve? How could I structure my programme better? All suggestions would be appreciated.
World.java:
...