Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ataymano/queue size control #1663

Closed

Conversation

ataymano
Copy link
Member

Sampling based on queue capacity

@@ -29,6 +30,7 @@ namespace reinforcement_learning {
if (!_queue.empty())
{
*item = std::move(_queue.front());
_capacity = (std::max)((int)0, (int)_capacity - (int)(item->size()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include

@@ -29,6 +30,7 @@ namespace reinforcement_learning {
if (!_queue.empty())
{
*item = std::move(_queue.front());
_capacity = (std::max)((int)0, (int)_capacity - (int)(item->size()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use static_cast instead of c style casts

@@ -29,6 +30,7 @@ namespace reinforcement_learning {
if (!_queue.empty())
{
*item = std::move(_queue.front());
_capacity = (std::max)((int)0, (int)_capacity - (int)(item->size()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the function name surrounded by parentheses?


private:
//thread-unsafe
typename queue_t::iterator erase(typename queue_t::iterator it) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create an alias for iterator_t to avoid having to use typename in the function signature

@jackgerrits
Copy link
Member

The reinforcement_learning directory has moved to its own repo. Can you please reopen this PR there? https://github.com/VowpalWabbit/reinforcement_learning

@lokitoth
Copy link
Member

lokitoth commented Nov 8, 2018

Superseded by VowpalWabbit/reinforcement_learning#15

@lokitoth lokitoth closed this Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants