Using std::bind_front
allowed
me to bind the original function see code bellow
auto
XLEUM =
std::bind_front(&NrMacSchedulerUeInfoA3C2::GetPotentialThroughputDl);
but now the issue is that I am trying to use that value of the return as part of my observation space (NS3-GYM module) of my RL algorithm and when I try to do that it basically returns the same error
Ptr<OpenGymDataContainer>
MyGymEnv::GetObservation()
{
auto XLEUM = std::bind_front(&NrMacSchedulerUeInfoA3C2::GetPotentialThroughputDl);
uint32_t numValues = 6;
std::vector<uint32_t> shape = {numValues,};
Ptr<OpenGymBoxContainer<double> > box2 = CreateObject<OpenGymBoxContainer<double> >(shape);
(Error)
/home/kotymmm/ns-3-dev/scratch/Mohsen01BWP/mygym.cc:
In member function ‘virtual ns3::Ptr<ns3::OpenGymDataContainer>
ns3::MyGymEnv::GetObservation()’:
/home/kotymmm/ns-3-dev/scratch/Mohsen01BWP/mygym.cc:190:18:
error: cannot convert ‘std::_Bind_front<double (*)(const
std::pair<std::shared_ptr<ns3::NrMacSchedulerUeInfo>,
unsigned int>&, const
std::pair<std::shared_ptr<ns3::NrMacSchedulerUeInfo>,
unsigned int>&)>’ to ‘double’
190
| box2->AddValue(XLEUM);
|
^~~~~
|
|
|
std::_Bind_front<double (*)(const
std::pair<std::shared_ptr<ns3::NrMacSchedulerUeInfo>,
unsigned int>&, const
std::pair<std::shared_ptr<ns3::NrMacSchedulerUeInfo>,
unsigned int>&)>
I
know that the error is coming from the type of the box itself but I
am unsure if there is a way to use the function as
it is now.. perhaps as a tuple? Or
is it a mistake in the way I am defining the std::bind_front ?
nr-mac-scheduler-ofdma.cc
NrMacSchedulerOfdma::AssignDLRBG(uint32_t symAvail, const ActiveUeMap& activeDl) const
for (auto& ue : ueVector)
{BeforeDlSched(ue, FTResources(rbgAssignable * beamSym, beamSym));}
while (resources > 0){GetFirst GetUe;std::sort(ueVector.begin(), ueVector.end(), GetUeCompareDlFn());↓nr-mac-scheduler-ofdma-pf.ccNrMacSchedulerOfdmaPF::GetUeCompareDlFn() const{return NrMacSchedulerUeInfoPF::CompareUeWeightsDl;}↓nr-mac-scheduler-ue-info-pf.hstatic bool CompareUeWeightsDl(const NrMacSchedulerNs3::UePtrAndBufferReq& lue,const NrMacSchedulerNs3::UePtrAndBufferReq& rue){auto luePtr = dynamic_cast<NrMacSchedulerUeInfoPF*>(lue.first.get());auto ruePtr = dynamic_cast<NrMacSchedulerUeInfoPF*>(rue.first.get());double lPfMetric = std::pow(luePtr->m_potentialTputDl, luePtr->m_alpha) /std::max(1E-9, luePtr->m_avgTputDl);double rPfMetric = std::pow(ruePtr->m_potentialTputDl, ruePtr->m_alpha) /std::max(1E-9, ruePtr->m_avgTputDl);return (lPfMetric > rPfMetric);}
--
You received this message because you are subscribed to the Google Groups "5G-LENA-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 5g-lena-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/5g-lena-users/8a6d2bcc-863b-451e-b051-7c451c4e1f7en%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "5G-LENA-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 5g-lena-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/5g-lena-users/119cc9ef-d237-4253-acd9-3bfb0549dba2n%40googlegroups.com.