mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-19 19:16:34 +00:00
With debugging hooks still on display, makes first attempt at dynamic analysis.
This commit is contained in:
@@ -13,7 +13,9 @@ using namespace Analyser::Dynamic;
|
||||
MultiMachine::MultiMachine(std::vector<std::unique_ptr<DynamicMachine>> &&machines) :
|
||||
machines_(std::move(machines)),
|
||||
configuration_target_(machines_),
|
||||
crt_machine_(machines_) {}
|
||||
crt_machine_(machines_) {
|
||||
crt_machine_.set_delegate(this);
|
||||
}
|
||||
|
||||
ConfigurationTarget::Machine *MultiMachine::configuration_target() {
|
||||
return &configuration_target_;
|
||||
@@ -38,3 +40,23 @@ Configurable::Device *MultiMachine::configurable_device() {
|
||||
Utility::TypeRecipient *MultiMachine::type_recipient() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MultiMachine::multi_crt_did_run_machines() {
|
||||
DynamicMachine *front = machines_.front().get();
|
||||
// for(const auto &machine: machines_) {
|
||||
// CRTMachine::Machine *crt = machine->crt_machine();
|
||||
// printf("%0.2f ", crt->get_confidence());
|
||||
// crt->print_type();
|
||||
// printf("; ");
|
||||
// }
|
||||
// printf("\n");
|
||||
std::stable_sort(machines_.begin(), machines_.end(), [] (const auto &lhs, const auto &rhs){
|
||||
CRTMachine::Machine *lhs_crt = lhs->crt_machine();
|
||||
CRTMachine::Machine *rhs_crt = rhs->crt_machine();
|
||||
return lhs_crt->get_confidence() > rhs_crt->get_confidence();
|
||||
});
|
||||
|
||||
if(machines_.front().get() != front) {
|
||||
crt_machine_.did_change_machine_order();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user