Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

[Completed] NUS Computer Science - cs2030 project 1, "Discrete Event Simulator"

License

Notifications You must be signed in to change notification settings

Jaimeloeuf/cs2030-project-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS2030 Java Project

My attempt of this project. Ques is a html page

Build and run with

javac *.java -d ./build/;
javac ./Main.java -d ./build/; # Only run this again if the only thing you modified is Main.java
java -cp ./build/ Main;

Notes

  • execute updates the state of the servers, and returns a new event to be chained / added to queue to operate
  • Problem: For event transitions like from Done to Serve, the server is updated but since Serve is instantiated in Wait event, passing in a currentServer object will just get outdated by the time "execute" method is executed.
    • Solution: Pass in and Store serverID instead for Event instantiations and use it to get server object from ServerList that is garunteed to always be updated.
    • ServerList.getServerByID(this.servers, this.serverID);
  • on every execute method, if the current server is needed, use the serverID to get it from the ServerList.getServerByID method, to ensure that the currentServer is always the latest updated version of the server object.

License

MIT, do whatever you want with this. Just perhaps dont copy for the same mod 😂?

About

[Completed] NUS Computer Science - cs2030 project 1, "Discrete Event Simulator"

Topics

Resources

License

Stars

Watchers

Forks