def get_attribute_register(self) -> EncodingRegister:
     dict_register = {}
     dict_register["list_taken"] = {"name": "list_taken",
                                    "type": [TypeAttribute.LIST_BOOLEAN,
                                             TypeAttribute.LIST_BOOLEAN_KNAP],
                                    "n": self.nb_items}
     return EncodingRegister(dict_register)
    def get_attribute_register(self) -> EncodingRegister:
        dict_register = {}
        max_number_modes = max([
            len(list(self.mode_details[x].keys()))
            for x in self.mode_details.keys()
        ])
        dict_register["priority_list_task"] = {
            "name": "priority_list_task",
            "type":
            [TypeAttribute.PERMUTATION, TypeAttribute.PERMUTATION_RCPSP],
            "range": range(self.n_jobs_non_dummy),
            "n": self.n_jobs_non_dummy
        }
        dict_register["priority_worker_per_task_perm"] = {
            "name": "priority_worker_per_task",
            "type":
            [TypeAttribute.PERMUTATION, TypeAttribute.PERMUTATION_RCPSP],
            "range": range(self.n_jobs_non_dummy * len(self.employees.keys())),
            "n": self.n_jobs_non_dummy * len(self.employees.keys())
        }
        dict_register["priority_worker_per_task"] = {
            "name": "priority_worker_per_task",
            "type": [List[List[int]]]
        }
        dict_register["modes_vector"] = {
            "name": "modes_vector",
            "n": self.n_jobs_non_dummy,
            "arrity": max_number_modes,
            "type": [TypeAttribute.LIST_INTEGER]
        }

        mode_arrity = [
            len(
                list(self.mode_details[list(
                    self.mode_details.keys())[i]].keys()))
            for i in range(1,
                           len(self.mode_details.keys()) - 1)
        ]
        dict_register["modes_arrity_fix"] = {
            "name": "modes_vector",
            "type": [TypeAttribute.LIST_INTEGER_SPECIFIC_ARRITY],
            "n": self.n_jobs_non_dummy,
            "arrities": mode_arrity
        }
        dict_register["modes_arrity_fix_from_0"] = {
            "name": "modes_vector_from0",
            "type": [TypeAttribute.LIST_INTEGER_SPECIFIC_ARRITY],
            "n": self.n_jobs_non_dummy,
            "arrities": mode_arrity
        }

        dict_register["schedule"] = {
            "name": "schedule",
            "type": [Dict[int, Dict[str, int]]]
        }
        dict_register["employee_usage"] = {
            "name": "employee_usage",
            "type": [Dict[int, Dict[int, Set[str]]]]
        }
        return EncodingRegister(dict_register)
Example #3
0
 def get_attribute_register(self) -> EncodingRegister:
     dict_register = dict()
     dict_register["facility_for_customers"] = {
         "name": "facility_for_customers",
         "type": [TypeAttribute.LIST_INTEGER],
         "n": self.customer_count,
         "arrity": self.facility_count
     }
     return EncodingRegister(dict_register)
 def get_attribute_register(self) -> EncodingRegister:
     dict_register = {
                     # "colors": {"type": [TypeAttribute.LIST_INTEGER],
                     #             "range_value": [0, self.number_of_nodes-1]},
                      "colors": {"name": "colors",
                                 "type": [TypeAttribute.LIST_INTEGER],
                                 "n": self.number_of_nodes,
                                 "arrity": self.number_of_nodes
                                 }
                      }
     return EncodingRegister(dict_register)
Example #5
0
 def get_attribute_register(self) -> EncodingRegister:
     dict_attribute = {
         "tour": {
             "name": "tour",
             "type":
             [TypeAttribute.PERMUTATION, TypeAttribute.PERMUTATION_TSP
              ],  # TODO, untrue at the moment..
             "range": range(self.numberOfNodes),
             "n": self.numberOfNodes
         }
     }
     return EncodingRegister(dict_attribute)
 def get_attribute_register(self) -> EncodingRegister:
     dict_register = {}
     dict_register["modes"] = {"name": "modes", "type": [Dict[int, int]]}
     # print('max_number_modes: ', max_number_modes)
     dict_register["schedule"] = {
         "name": "schedule",
         "type": [Dict[int, Dict[str, int]]]
     }
     dict_register["employee_usage"] = {
         "name": "employee_usage",
         "type": [Dict[int, Dict[int, Set[str]]]]
     }
     return EncodingRegister(dict_register)
Example #7
0
 def get_attribute_register(self) -> EncodingRegister:
     dict_register = {}
     dict_register["permutation_from0"] = {
         "name": "permutation_from0",
         "type": [TypeAttribute.PERMUTATION],
         "range": range(len(self.original_indices_to_permutation_indices)),
         "n": len(self.original_indices_to_permutation_indices)
     }
     dict_register["permutation"] = {
         "name": "permutation",
         "type": [TypeAttribute.PERMUTATION, TypeAttribute.PERMUTATION_TSP],
         "range": self.ind_in_permutation,
         "n": self.length_permutation
     }
     return EncodingRegister(dict_register)
Example #8
0
 def get_attribute_register(self) -> EncodingRegister:
     dict_encoding = {"list_paths": {"name": "list_paths", "type": [TypeAttribute.LIST_INTEGER]}}
     return EncodingRegister(dict_encoding)