Skip to content

Commit

Permalink
arm/policy became pure virtual func
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomiyama committed Mar 14, 2014
1 parent 3182608 commit a6f05ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
18 changes: 3 additions & 15 deletions arm/arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,9 @@ namespace bandit{
class Arm{
public:
//base functions should not be called
virtual double pull(){
std::cout << "unexpected base Arm::pull function call" << std::endl;
abort();
return 0;
}
virtual double getExpectedReward(){
std::cout << "unexpected base Arm::getExpectedReward function call" << std::endl;
abort();
return 0;
}
virtual std::string toString(){
std::cout << "unexpected base Arm::toString function call" << std::endl;
abort();
return "";
}
virtual double pull() = 0;
virtual double getExpectedReward() = 0;
virtual std::string toString() = 0;
};

} //namespace
17 changes: 3 additions & 14 deletions policy/policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,9 @@ namespace bandit{
class Policy{
public:
//base functions should not be called
virtual int selectNextArm(){
std::cout << "unexpected base Policy::selectNextArm function call" << std::endl;
abort();
return -1;
}
virtual void updateState(int, double){
std::cout << "unexpected base Policy::updateState function call" << std::endl;
abort();
}
virtual std::string toString(){
std::cout << "unexpected base Policy::toString function call" << std::endl;
abort();
return "";
}
virtual int selectNextArm() = 0;
virtual void updateState(int, double) = 0;
virtual std::string toString() = 0;
};

} //namespace

0 comments on commit a6f05ba

Please sign in to comment.