ratedMove.h
Go to the documentation of this file.
/* ratedMove.h
*/
#ifndef OSL_RATEDMOVE_H
#define OSL_RATEDMOVE_H
#include "osl/basic_type.h"
#include <iosfwd>
namespace osl
{
namespace rating
{
class RatedMove
{
Move my_move;
signed short all_rating, optimistic_rating;
public:
RatedMove(Move move, int rating, int optimistic) : my_move(move), all_rating(rating), optimistic_rating(optimistic)
{
}
RatedMove(Move move, int rating) : my_move(move), all_rating(rating), optimistic_rating(rating)
{
}
RatedMove() : all_rating(0), optimistic_rating(0) {}
void setRating(int rating) { all_rating = rating; }
void setOptimisticRating(int rating) { optimistic_rating = rating; }
const Move move() const { return my_move; }
int rating() const { return all_rating; }
int optimisticRating() const { return optimistic_rating; }
};
std::ostream& operator<<(std::ostream& os, RatedMove const& moveLogProb);
inline bool operator==(RatedMove const& lhs, RatedMove const& rhs)
{
return lhs.move()==rhs.move() && lhs.rating()==rhs.rating();
}
inline bool operator<(RatedMove const& lhs, RatedMove const& rhs)
{
if (lhs.rating() != rhs.rating())
return lhs.rating() < rhs.rating();
if (lhs.optimisticRating() != rhs.optimisticRating())
return lhs.optimisticRating() < rhs.optimisticRating();
return lhs.move() < rhs.move();
}
inline bool operator>(RatedMove const& lhs, RatedMove const& rhs)
{
if (lhs.rating() != rhs.rating())
return lhs.rating() > rhs.rating();
if (lhs.optimisticRating() != rhs.optimisticRating())
return lhs.optimisticRating() > rhs.optimisticRating();
return lhs.move() < rhs.move();
}
}
using rating::RatedMove;
} // namespace osl
#endif /* OSl_RATEDMOVE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
basic_type.h
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::RatedMove::RatedMove
RatedMove(Move move, int rating, int optimistic)
Definition ratedMove.h:18
osl::rating::RatedMove
Definition ratedMove.h:14
osl::rating::RatedMove::optimisticRating
int optimisticRating() const
Definition ratedMove.h:30
osl::rating::RatedMove::RatedMove
RatedMove(Move move, int rating, int optimistic)
Definition ratedMove.h:18
osl::rating::RatedMove::setOptimisticRating
void setOptimisticRating(int rating)
Definition ratedMove.h:26
osl::rating::RatedMove::all_rating
signed short all_rating
Definition ratedMove.h:16
osl::rating::RatedMove::optimistic_rating
signed short optimistic_rating
Definition ratedMove.h:16
osl::rating::RatedMove::my_move
Move my_move
Definition ratedMove.h:15
osl::rating::RatedMove::RatedMove
RatedMove(Move move, int rating)
Definition ratedMove.h:21
osl::rating::RatedMove::rating
int rating() const
Definition ratedMove.h:29
osl::rating::RatedMove::RatedMove
RatedMove()
Definition ratedMove.h:24
osl::rating::RatedMove::move
const Move move() const
Definition ratedMove.h:28
osl::rating::RatedMove::setRating
void setRating(int rating)
Definition ratedMove.h:25
osl::rating
Definition construct.h:18
osl::rating::operator==
bool operator==(RatedMove const &lhs, RatedMove const &rhs)
Definition ratedMove.h:35
osl::rating::operator<<
std::ostream & operator<<(std::ostream &os, RatedMove const &moveLogProb)
Definition ratedMove.cc:6
osl::rating::operator>
bool operator>(RatedMove const &lhs, RatedMove const &rhs)
Definition ratedMove.h:47
osl::rating::operator<
bool operator<(RatedMove const &lhs, RatedMove const &rhs)
Definition ratedMove.h:39
osl
Definition additionalEffect.h:6