samindaa / RLLib

C++ Template Library to Predict, Control, Learn Behaviors, and Represent Learnable Knowledge using On/Off Policy Reinforcement Learning
http://web.cs.miami.edu/home/saminda/rllib.html
196 stars 51 forks source link

ActorLambda::initialize calls Actor::initialize with an extra parameter #5

Open marcotama opened 8 years ago

marcotama commented 8 years ago

I am trying to wrap this library using SWIG. However, the compiler complains that Base, which is of type Actor (in file ControlAlgorithm.h) only provides a method initialize() with no parameters, while method ActorLambda::initialize calls it passing an argument. These are lines 736 and 748--752 of file ControlAlgorithm.h

      typedef Actor<T> Base;
      void initialize(const Vector<T>* x)
      {
        Base::initialize(x);
        e->clear();
      }

and this the output of my compiler:

In file included from RLLib_/Function.h:25:0,
                 from PyRLLib_wrap.cxx:3163:
RLLib_/Vector.h: In instantiation of ‘RLLib::Vectors_<T>::Vectors_(const RLLib::Vectors_<T>&) [with T = double]’:
PyRLLib_wrap.cxx:8792:111:   required from here
RLLib_/Vector.h:1173:63: error: conversion from ‘RLLib::Vectors_<double>::const_iterator {aka __gnu_cxx::__normal_iterator<RLLib::Vector_<double>* const*, std::vector<RLLib::Vector_<double>*, std::allocator<RLLib::Vector_<double>*> > >}’ to non-scalar type ‘RLLib::Vectors_<double>::iterator {aka __gnu_cxx::__normal_iterator<RLLib::Vector_<double>**, std::vector<RLLib::Vector_<double>*, std::allocator<RLLib::Vector_<double>*> > >}’ requested
         for (typename Vectors_<T>::iterator iter = that.begin(); iter != that.end(); ++iter)
                                                               ^
In file included from PyRLLib_wrap.cxx:3172:0:
RLLib_/ControlAlgorithm.h: In instantiation of ‘void RLLib::ActorLambda_<T>::initialize(const RLLib::Vector_<T>*) [with T = double]’:
PyRLLib_wrap.cxx:28151:60:   required from here
RLLib_/ControlAlgorithm.h:750:27: error: no matching function for call to ‘RLLib::ActorLambda_<double>::initialize(const RLLib::Vector_<double>*&)’
         Base::initialize(x);
                           ^
RLLib_/ControlAlgorithm.h:750:27: note: candidate is:
RLLib_/ControlAlgorithm.h:691:12: note: void RLLib::Actor_<T>::initialize() [with T = double]
       void initialize()
            ^
RLLib_/ControlAlgorithm.h:691:12: note:   candidate expects 0 arguments, 1 provided
marcotama commented 8 years ago

My compiler is c++ (Debian 4.9.2-10) 4.9.2.