This is an implementation of a genetic algorithm in java
The infinite monkey theorem says that a monkey randomly hitting keys on a typewriter will eventually type out one of William Shakespeare's works.
Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
This problem consists in a creating a timetable with the following rules:
- Classes can only be carried out in rooms that are free in a time frame;
- A teacher can only teach a lesson un at a time;
- The rooms should be large enough to accommodate a class. To the solution there are a few considerations that you need to have in mind:
- You need rooms;
- Teachers;
- Curricular units;
- Class;
- Hour Block <2h>;
- Lessons composed of (Class, Curricular unit, Teacher, Hour Block, Room).
JC := javac
J := java
JCFLAGS := -d $(OUT_DIR)/ -cp $(SRC_DIR)/
EXEC := main.Main # The name and package of the main class
- Compile with the
make
command:make -j$(nproc)
or justmake
- Run
make run
to run the program.
In the make file the CC
variable contains the compiler, this can be changed to clang
instead of gcc
CC = gcc
CFLAGS := -g -Wall -Wextra -pedantic
To change the executable name in the makefile there is a variable called EXEC
that controls the name.
...
EXEC := main
...
- Compile with the
make
command:make -j$(nproc)
or justmake
- Run
./main
or the name specified in the Makefile