diff --git a/README.md b/README.md index 2e9402f..3c5c9a0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,49 @@ # Minecraft Base Project -IntelliJ base project related to Minecraft Lab of 221_SIn & 231_SIn course \ No newline at end of file +IntelliJ base project related to Minecraft Lab of 221_SIn & 231_SIn course + +## Purpose +This project is made during the 4th semester of study in Industrial Systems at the University of Engineering in Sion, +Wallis, Switzerland. It is used to learn the basics of DevOps, Database, web development and modbus communication. +This project is made by a group of 2 students. This project was made during 7 weeks and cut into 6 parts. +The goal of this project is to interface a Minecraft mod. This mod is a simulation of a micro-gri. Our goal is to +read electrical value from the Minecraft world and save it in database, display it on a web page and finally send +regulation value to the Minecraft world for keep the micro-gri stable. +To reach this goal, we have to use a modbus communication between the Minecraft world and our program. +The program is divided into 6 parts: + +### Core part +The core part is the main part of the project. It is the part that will be used to communicate with the other parts. +In Core, we have the management of DataPoints. A DataPoint is a virtual copy of a Minecraft input or output. In Core, +we have a static Map of DataPoints. The key of the map is the name of the DataPoint and the value is the DataPoint +itself. The DataPoint class is an abstract class. It has 2 subclasses, FloatDataPoint and BooleanDataPoint. + +### Database part +The database part is the part that will be used to store the DataPoints. All DataPoints are send with a http POST +request to the database. The database use in this project is InfluxDB. InfluxDB is a time series database. We use +after Grafana to display the data. Database part can also erase all the data in the database. +The time management is also on this class. The goal of this class is to convert the time from the Minecraft server +to the real time. We start to send data to the database only when the Minecraft server is started. + +### Web part +The web part is the part that will be used to display the data from the database. We already have a web page that is +given by teacher. We use a websocket to interface with web page. With this web page we can read Minecraft data and +set some regulation value. We also add a switch to start or stop the smart part. + +### Modbus part +The modbus part is the part that will be used to communicate with the Minecraft world. We use the modbus TCP +communication. We use the library modbus4j. + +### Field part +The field part is the part that will be used to connect modbus part to the core part. We read a csv file to know all +the modbus address and the name of the DataPoint. With this file, we can link DataPoint to minecraft input or output. + +### Smart part +The smart part is the part that will be used to send regulation value to the Minecraft world. We make a very simple +regulation just for keep the grid alive during the time of the simulation. We stop our program when the Minecraft +simulation send a score. This score is how many production we have made with the factory during the simulation. So +the goal is to maximize this score. We didn't have time to make a better regulation. + +## How to use +To use this project you can just download the last release and run the JAR file with some arguments. +The arguments are: