Skip to content

Commit

Permalink
Refactored readme file;
Browse files Browse the repository at this point in the history
  • Loading branch information
th-rpy committed Apr 30, 2024
1 parent 33a293e commit bdeacea
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,32 @@ from jacksonpy import JacksonAlgo
data_path = "YOUR_PATH/input.txt" # path to the data file
d = JacksonAlgo.Data(data_path) # create a Data object with the path to the data file
data = (
d.get_job_durations()
d.get_job_durations()
) # get the durations: list of list of integers [[J1, dur1, dur2, dur3], [J2, dur1, dur2, dur3] ...]

# Solving the problem
al = JacksonAlgo.JackAlgo(data) # create a JackAlgo object with the data

print(al) # print the problem details

preparedData = al.prepareData() # prepare the data for the algorithm
preparedData = al.prepare_data() # prepare the data for the algorithm
cmaxVirtual, _, __ = al.get_cmax_virtual(
preparedData
preparedData
) # get the cmaxVirtual result of the virtual sub-problems
result = al.solve(
cmaxVirtual
cmaxVirtual
) # solve the problem and save the result in the result variable
al.generate_pdf_file(
results=result
results=result
) # generate a pdf file with the result of the problem


########################## Example using Json file ##########################

# Reading and manipulating data
data_path = "YOUR_PATH//input.json" # path to the data file
d = JacksonAlgo.Data(data_path) # create a Data object with the path to the data file
data = (
d.get_job_durations()
d.get_job_durations()
) # get the durations: list of list of integers [[J1, dur1, dur2, dur3], [J2, dur1, dur2, dur3] ...]
print(data) # print the data

Expand All @@ -102,70 +101,70 @@ al = JacksonAlgo.JackAlgo(data) # create a JackAlgo object with the data

print(al) # print the problem details

preparedData = al.prepareData() # prepare the data for the algorithm
preparedData = al.prepare_data() # prepare the data for the algorithm
cmaxVirtual, _, __ = al.get_cmax_virtual(
preparedData
preparedData
) # get the cmaxVirtual result of the virtual sub-problems
result = al.solve(
cmaxVirtual
cmaxVirtual
) # solve the problem and save the result in the result variable
al.generate_pdf_file(
results=result
results=result
) # generate a pdf file with the result of the problem

########################## Example using 2d array ##########################

# Reading and manipulating data (defined as a lis of lists of integers)
data = [
[1, 7, 5, 6, 9, 10],
[2, 4, 6, 5, 8, 1],
[3, 8, 2, 4, 3, 7],
[4, 6, 3, 9, 7, 5],
[5, 5, 7, 3, 5, 9],
[1, 7, 5, 6, 9, 10],
[2, 4, 6, 5, 8, 1],
[3, 8, 2, 4, 3, 7],
[4, 6, 3, 9, 7, 5],
[5, 5, 7, 3, 5, 9],
] # list of list of integers [[J1, dur1, dur2, dur3], [J2, dur1, dur2, dur3] ...]

# Solving the problem
al = JacksonAlgo.JackAlgo(data) # create a JackAlgo object with the data

print(al) # print the problem details

preparedData = al.prepareData() # prepare the data for the algorithm
preparedData = al.prepare_data() # prepare the data for the algorithm
cmaxVirtual, _, __ = al.get_cmax_virtual(
preparedData
preparedData
) # get the cmaxVirtual result of the virtual sub-problems
result = al.solve(
cmaxVirtual
cmaxVirtual
) # solve the problem and save the result in the result variable
al.generate_pdf_file(
results=result
results=result
) # generate a pdf file with the result of the problem

########################## Example using dictionary ##########################

# Reading and manipulating data (defined as a lis of lists of integers)
data = {
"Task 1": [3, 4, 6, 5],
"Task 2": [2, 3, 6, 9],
"Task 3": [8, 9, 2, 6],
"Task 4": [7, 6, 3, 2],
"Task 5": [3, 6, 4, 5],
"Task 6": [5, 8, 7, 9],
"Task 1": [3, 4, 6, 5],
"Task 2": [2, 3, 6, 9],
"Task 3": [8, 9, 2, 6],
"Task 4": [7, 6, 3, 2],
"Task 5": [3, 6, 4, 5],
"Task 6": [5, 8, 7, 9],
} # dictionary of lists of integers {'Task 1': [3, 4, 6, 5], 'Task 2': [2, 3, 6, 9], ...}

# Solving the problem
al = JacksonAlgo.JackAlgo(data) # create a JackAlgo object with the data

print(al) # print the problem details

preparedData = al.prepareData() # prepare the data for the algorithm
preparedData = al.prepare_data() # prepare the data for the algorithm
cmaxVirtual, _, __ = al.get_cmax_virtual(
preparedData
preparedData
) # get the cmaxVirtual result of the virtual sub-problems
result = al.solve(
cmaxVirtual
cmaxVirtual
) # solve the problem and save the result in the result variable
al.generate_pdf_file(
results=result
results=result
) # generate a pdf file with the result of the problem
```

Expand Down

0 comments on commit bdeacea

Please sign in to comment.