From 6cdc08d5d637f71978d9219cd96be207aadb2d63 Mon Sep 17 00:00:00 2001 From: Austin Ferguson Date: Thu, 30 Jun 2022 12:29:00 -0400 Subject: [PATCH] Add GetNumInstsCopied method to VirtualCPU --- include/emp/hardware/VirtualCPU.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/emp/hardware/VirtualCPU.hpp b/include/emp/hardware/VirtualCPU.hpp index d648bc45ed..e514fab198 100644 --- a/include/emp/hardware/VirtualCPU.hpp +++ b/include/emp/hardware/VirtualCPU.hpp @@ -135,9 +135,9 @@ namespace emp{ genome_t genome_working; ///< Working copy of genome that can mutate, resize, and change //////// BOOKKEEPING size_t active_stack_idx = 0; ///< Index of CPU's active stack - emp::vector copied_inst_id_vec; ///< Vector of instructions that have been - ///< copied - size_t num_insts_executed = 0; + emp::vector copied_inst_id_vec; /**< Vector of instructions that have been + copied */ + size_t num_insts_executed = 0; ///< Number of instructions that have been executed //////// CONSTRUCTORS / DESTRUCTOR @@ -277,6 +277,10 @@ namespace emp{ genome_working.erase(genome_working.begin() + idx); nops_need_curated = true; } + /// Return the number of instruction that have been copied + size_t GetNumInstsCopied() const{ + return copied_inst_id_vec.size(); + }