Commit a392165c authored by upedk's avatar upedk
Browse files

Scenario plotting fixes.

parent d8328cf5
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -66,7 +66,6 @@ def dsm_mutate(individual, job_dict):
return individual
def eval_fitness(individual, optimization_length, optimization_start, consumers_number, job_dict, power, working_hours,
verbose=False, final_eval=False):
"""
......@@ -236,7 +235,7 @@ def dsm_var_and(population, toolbox, mut_prob, crossover_prob, job_dict):
return offspring
def main_ga(population, toolbox, cxpb, mutpb, ngen, stats, halloffame, job_dict):
def main_ga(population, toolbox, cxpb, mutpb, ngen, stats, halloffame, job_dict, cache_folder_path):
logbook = tools.Logbook()
logbook.header = ['gen', 'nevals'] + (stats.stat_values if stats else [])
......@@ -312,6 +311,11 @@ def main_ga(population, toolbox, cxpb, mutpb, ngen, stats, halloffame, job_dict)
hof_evolution.append(copy.deepcopy(halloffame))
print('Gen loop time: ' + str(time.perf_counter() - gen_loop_time))
print(logbook.stream)
#print(logbook.stream)
with open(cache_folder_path + '/logbooks/logbook_progress.txt', 'a') as \
logbook_file:
print(logbook.stream, file=logbook_file)
return population, logbook, hof_evolution
......@@ -4,7 +4,7 @@ consumer_data_path = './input/Consumer Data Input v05 one month.xlsx'
# GA parameter
pop_size = 600
n_gen = 7500
n_gen = 1000
tourn_size = 3
......
This diff is collapsed.
......@@ -4,12 +4,12 @@ consumer_data_path = './input/Consumer Data Input v05 one month.xlsx'
# GA parameter
pop_size = 600
n_gen = 7500
n_gen = 1000
tourn_size = 3
crossover_prob = 0.5
mut_prob = 0.5
mut_prob = 0.8
# Objective weights -> all minimized
power_objective = 3
......
This diff is collapsed.
This diff is collapsed.
# Input files
input_data_path = './input/System Design Input v08.xlsx'
consumer_data_path = './input/Consumer Data Input v05 one month.xlsx'
# GA parameter
pop_size = 600
n_gen = 1000
tourn_size = 3
crossover_prob = 0.5
mut_prob = 1
# Objective weights -> all minimized
power_objective = 3
blocked_hours_objective = 2
possible_hours_objective = 1
parallel_schedule_objective = 100
# timeframe_objective = -1.0 # Not needed since timeframe violations are not possible due to seeding and mutation
# General parameters
optimization_start = 0
optimization_length = 8760
use_multiprocessing = False
# Buffer in kW of that scheduled consumption needs to be below produced power [kW].
power_buffer = 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment