Skip to content

Commit

Permalink
fixes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoang29 committed Oct 6, 2014
1 parent 6e49008 commit d457d15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions explore/clr/vw_explore_clr_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ namespace MultiWorldTesting {
UInt64 JoinId;
};

public ref class ActionID
{
public:
static UInt32 Make_OneBased(UInt32 id) { return MWTAction::Make_OneBased(id); }
static UInt32 Make_ZeroBased(UInt32 id) { return MWTAction::Make_ZeroBased(id); }
};

public ref class MWTWrapper
{
private:
Expand Down
4 changes: 2 additions & 2 deletions explore/tests/MWTExploreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ private static UInt32 TestStatelessPolicyFunc(IntPtr applicationContext)
GCHandle contextHandle = (GCHandle)applicationContext;
CONTEXT context = (contextHandle.Target as CONTEXT);

return (uint)context.Features.Length % MWTExploreTests.NumActions + 1;
return ActionID.Make_OneBased((uint)context.Features.Length % MWTExploreTests.NumActions);
}

private static UInt32 TestStatefulPolicyFunc(IntPtr policyParams, IntPtr applicationContext)
{
GCHandle contextHandle = (GCHandle)applicationContext;
CONTEXT context = (contextHandle.Target as CONTEXT);

return (uint)(policyParams + context.Features.Length) % MWTExploreTests.NumActions + 1;
return ActionID.Make_OneBased((uint)(policyParams + context.Features.Length) % MWTExploreTests.NumActions);
}

private static void TestStatefulScorerFunc(IntPtr policyParams, IntPtr applicationContext, float[] scores, uint size)
Expand Down

0 comments on commit d457d15

Please sign in to comment.