#ifndef IsIx5LlrtRM4hjuaHq11FAgirk #define IsIx5LlrtRM4hjuaHq11FAgirk #include #include #include #include #include "template_helpers.hpp" #include "time.hpp" #include "quant_types.hpp" #include "model.hpp" // for Weight namespace PLA_InitByCopy_Impl { using namespace boost; using namespace boost::mpl; template struct Action { template void operator() (Data &, Time) {} // NOOP on discrete quants }; template struct Action { typedef typename Prop::quant Quant; template void operator() (Data &data, Time time) { PropertyInstance src; typedef typename if_, uint8_t, typename Prop::instance_ptr_t::ptr_t >::type ptr_t; assert(time <= src.data.timeLimit); // we do not want to cause addCheckpoint() for (ptr_t i = 0; i < Prop::instance_ptr_t::numInstances(); i++) data.data.set(src.data.getTime(time, i), i, src.data.getValue(time, i)); } }; struct PLA_InitByCopy { // action types & consts typedef Void result_t; template struct local_state_t : Action {}; // action state result_t result; Time time; PLA_InitByCopy(Time time) : time(time) {} // action methods template inline void pre(_PC &, ContextData &data, LocalState &action) { action(data, time); } template inline void post(_PC &, _Data &, _LocalState &) { } }; } // namespace PLA_InitByCopy_Impl using PLA_InitByCopy_Impl::PLA_InitByCopy; #endif // IsIx5LlrtRM4hjuaHq11FAgirk