quast_decisiontree.nodes.algorithm_execute
quast_decisiontree.nodes.algorithm_execute
logger
module-attribute
logger = logging.getLogger('dt_logger')
ClassicalAlgorithmExecuteNode
Bases: FinalNode
Executes a ClassicalAlgorithm instance after it has been set up.
Expects problem_data to contain
- solver: a ClassicalAlgorithm instance (e.g. BruteForce, TabuSolver)
- solver_input (or qubo_matrix as fallback): the optimization problem (typically a QUBO matrix) passed to execute()
The node uses the generic ClassicalAlgorithm.execute(opt_problem) interface, making it compatible with any ClassicalAlgorithm subclass.
Modifications at runtime: - execute: - True : executes algorithm without confirmation - False : prompts the user for confirmation before execution
Source code in src/quast_decisiontree/nodes/algorithm_execute.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
query
instance-attribute
query = MultiChoiceQuery(
question="Do you want to start execution of the algorithm now?",
answers=dict(yes="Yes", no="No"),
name="execute",
)
auto_execute
instance-attribute
auto_execute = auto_execute
__init__
__init__(children, auto_execute=False)
Source code in src/quast_decisiontree/nodes/algorithm_execute.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
execute
execute(problem_data, path_info)
Source code in src/quast_decisiontree/nodes/algorithm_execute.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
HybridAlgorithmExecuteNode
Bases: FinalNode
Executes a HybridAlgorithm instance after it has been set up.
Expects problem_data to contain
- hybrid_algorithm: a HybridAlgorithm instance (e.g. QrispQAOA)
- hybrid_inputs: dict mapping INPUT_KEYS to their values
- backend: the Backend to run on
The node uses the generic HybridAlgorithm.execute(backend, **inputs) interface, making it compatible with any HybridAlgorithm subclass.
Modifications at runtime: - execute: - True : executes algorithm without confirmation - False : prompts the user for confirmation before execution
Source code in src/quast_decisiontree/nodes/algorithm_execute.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
query
instance-attribute
query = MultiChoiceQuery(
question="Do you want to start execution of the algorithm now?",
answers=dict(yes="Yes", no="No"),
name="execute",
)
auto_execute
instance-attribute
auto_execute = auto_execute
__init__
__init__(children, auto_execute=False)
Source code in src/quast_decisiontree/nodes/algorithm_execute.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
execute
execute(problem_data, path_info)
Source code in src/quast_decisiontree/nodes/algorithm_execute.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |