Ejemplo n.º 1
0
    def evaluate(self, solution: FloatSolution) -> FloatSolution:
        Vars = solution.variables

        result = create_run_scenario_overtake(Vars, self.config)

        solution.objectives = result

        return solution
Ejemplo n.º 2
0
    def evaluate(self, solution: FloatSolution) -> FloatSolution:
        Vars = solution.variables

        result = create_run_scenario_overtake(Vars, self.config)

        solution.objectives = result

        ## check if find such pattern
        goal_flag = np.zeros((7), dtype=int)
        for j in range(7):
            if result[j] < self.target_value_threshold[j]:
                goal_flag[j] = 1
            else:
                goal_flag[j] = 0
        if (goal_flag == self.config.goal_selection_flag).all():
            self.problem_solved = 1

        return solution