mach_opt package
Module contents
- class mach_opt.DataHandler(*args, **kwargs)
Bases:
ProtocolParent class for all data handlers
- abstract save_designer(designer)
- abstract save_to_archive(x, design, full_results, objs)
- class mach_opt.Design
Bases:
ABCParent class for all designs
- class mach_opt.DesignOptimizationMOEAD(design_problem)
Bases:
object- initial_pop(pop_size)
- load_pop(filepath, pop_size)
- run_optimization(pop, gen_size, filepath='None')
- save_pop(filepath, pop)
- class mach_opt.DesignProblem(designer: Designer, evaluator: Evaluator, design_space: DesignSpace, dh: DataHandler)
Bases:
objectClass to create, evaluate, and optimize designs
- designer
Objects which convert free variables to a design.
- evaluator
Objects which evaluate the performance of different designs.
- design_space
Objects which characterizes the design space of the optimization.
- dh
Data handlers which enable saving optimization results and its resumption.
- fitness(x: tuple) tuple
Calculates the fitness or objectives of each design based on evaluation results.
This function creates, evaluates, and calculates the fitness of each design generated by the optimization algorithm. It also saves the results and handles invalid designs.
- Parameters
x – The list of free variables required to create a complete design
- Returns
Returns the fitness of each design
- Return type
objs
- Raises
e – The errors encountered during design creation or evaluation apart from the InvalidDesign error
- get_bounds()
Returns bounds for optimization problem
- get_nobj()
Returns number of objectives of optimization problem
- class mach_opt.DesignSpace(*args, **kwargs)
Bases:
ProtocolParent class for a optimization DesignSpace classes
- abstract bounds() tuple
- abstract check_constraints(full_results) bool
- abstract get_objectives(valid_constraints, full_results) tuple
- abstract n_obj() int
- class mach_opt.Designer(*args, **kwargs)
Bases:
ProtocolParent class for all designers
- class mach_opt.Evaluator(*args, **kwargs)
Bases:
ProtocolParent class for all design evaluators
- exception mach_opt.InvalidDesign(message='Invalid Design')
Bases:
ExceptionException raised for invalid designs
- class mach_opt.OptiData(x, design, full_results, objs)
Bases:
objectObject template for serializing optimization results with Pickle