OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
OptimizeCmd.h
Go to the documentation of this file.
1//
2// Class OptimizeCmd
3// The OptimizeCmd definition.
4// A OptimizeCmd definition is used to parse the parametes for the optimizer.
5//
6// Copyright (c) 2017, Christof Metzger-Kraus
7// All rights reserved
8//
9// This file is part of OPAL.
10//
11// OPAL is free software: you can redistribute it and/or modify
12// it under the terms of the GNU General Public License as published by
13// the Free Software Foundation, either version 3 of the License, or
14// (at your option) any later version.
15//
16// You should have received a copy of the GNU General Public License
17// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18//
19#ifndef OPAL_OptimizeCmd_HH
20#define OPAL_OptimizeCmd_HH
21
23
24#include "Util/CmdArguments.h"
25#include "Optimize/DVar.h"
27
28#include <string>
29
30class OptimizeCmd: public Action {
31
32public:
33
36
37 virtual ~OptimizeCmd();
38
40 virtual OptimizeCmd *clone(const std::string& name);
41
43 virtual void execute();
44
45private:
46
47 // Not implemented.
48 OptimizeCmd(const OptimizeCmd&) = delete;
49 void operator=(const OptimizeCmd&) = delete;
50
51 // Clone constructor.
52 OptimizeCmd(const std::string &name, OptimizeCmd* parent);
53
54 void stashEnvironment();
55 void popEnvironment();
56
57 enum class CrossOver {
58 Blend,
62 };
63 CrossOver crossoverSelection(const std::string& crossover);
64
65 enum class Mutation {
67 OneBit
68 };
69 Mutation mutationSelection(const std::string& mutation);
70
71 void run(const CmdArguments_t& args,
72 const functionDictionary_t& funcs,
73 const DVarContainer_t& dvars,
74 const Expressions::Named_t& objectives,
75 const Expressions::Named_t& constraints);
76};
77
78#endif
std::shared_ptr< CmdArguments > CmdArguments_t
std::map< std::string, DVar_t > DVarContainer_t
Definition Types.h:90
const std::string name
std::map< std::string, client::function::type > functionDictionary_t
Definition Expression.h:55
std::map< std::string, Expressions::Expr_t * > Named_t
type of an expressions with a name
Definition Expression.h:73
The base class for all OPAL actions.
Definition Action.h:30
virtual ~OptimizeCmd()
virtual OptimizeCmd * clone(const std::string &name)
Make clone.
void popEnvironment()
void operator=(const OptimizeCmd &)=delete
void run(const CmdArguments_t &args, const functionDictionary_t &funcs, const DVarContainer_t &dvars, const Expressions::Named_t &objectives, const Expressions::Named_t &constraints)
void stashEnvironment()
virtual void execute()
Execute the command.
CrossOver crossoverSelection(const std::string &crossover)
OptimizeCmd()
Exemplar constructor.
Mutation mutationSelection(const std::string &mutation)
OptimizeCmd(const OptimizeCmd &)=delete