Skip to content

Commit

Permalink
Preparation for syncing sources with internal repo (#275)
Browse files Browse the repository at this point in the history
* make class partial so I can add constuctor in separate file. add constructros for testing

* formatting
  • Loading branch information
Ivanidzo4ka authored May 31, 2018
1 parent 9d19d0e commit fbd4de0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Microsoft.ML.Sweeper/AsyncSweeper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public interface IAsyncSweeper
/// Expose existing <see cref="ISweeper"/>s as <see cref="IAsyncSweeper"/> with no synchronization over the past runs.
/// Nelder-Mead requires synchronization so is not compatible with SimpleAsyncSweeperBase.
/// </summary>
public class SimpleAsyncSweeper : IAsyncSweeper, IDisposable
public partial class SimpleAsyncSweeper : IAsyncSweeper, IDisposable
{
private readonly List<IRunResult> _results;
private readonly object _lock;
Expand All @@ -85,6 +85,16 @@ private SimpleAsyncSweeper(ISweeper baseSweeper)
_results = new List<IRunResult>();
}

public SimpleAsyncSweeper(IHostEnvironment env, UniformRandomSweeper.ArgumentsBase args)
: this(new UniformRandomSweeper(env, args))
{
}

public SimpleAsyncSweeper(IHostEnvironment env, RandomGridSweeper.Arguments args)
: this(new UniformRandomSweeper(env, args))
{
}

public void Update(int id, IRunResult result)
{
Contracts.CheckParam(0 <= id && id < _numGenerated, nameof(id), "Invalid run id");
Expand Down

0 comments on commit fbd4de0

Please sign in to comment.