Skip to content
Snippets Groups Projects
Commit 7ba540cb authored by Tobias's avatar Tobias
Browse files

-

parent d78575f1
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ namespace ControlComponents.Core
protected T controlComponent { get; private set; }
public string Role { get; }
public string Id { get; }
public string OwnerId { get; }
public ExecutionState EXST => controlComponent.ReadProperty<ExecutionState>(Role, nameof(EXST));
public ExecutionMode EXMODE => controlComponent.ReadProperty<ExecutionMode>(Role, nameof(EXMODE));
......@@ -60,7 +60,7 @@ namespace ControlComponents.Core
public OrderOutputTemplate(string role, string id, IControlComponentProvider provider)
{
Role = role;
Id = id;
OwnerId = id;
_provider = provider;
}
......@@ -243,7 +243,7 @@ namespace ControlComponents.Core
public override int GetHashCode()
{
return (Role + Id).GetHashCode();
return (Role + OwnerId).GetHashCode();
}
public void ClearOutput(string role)
......
......@@ -4,12 +4,24 @@ using ControlComponents.Core;
namespace ControlComponents.ML
{
public class MLProviderOrderOutput : OrderOutput
public class MLProviderOrderOutput : OrderOutput// , IMLControlComponent
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
private readonly IMLControlComponent cc;
private Task _running = Task.CompletedTask;
// public ExecutionState MLSC { get => cc.MLSC; set => cc.MLSC = value; }
// public string MLMODEL => cc.MLMODEL;
// public float[] MLOBSERVE { get => cc.MLOBSERVE; set => cc.MLOBSERVE = value; }
// public bool[][] MLENACT { get => cc.MLENACT; set => cc.MLENACT = value; }
// public float[][] MLDECIDE { get => cc.MLDECIDE; set => cc.MLDECIDE = value; }
// public float MLREWARD { get => cc.MLREWARD; set => cc.MLREWARD = value; }
// public string MLSTATS { get => cc.MLSTATS; set => cc.MLSTATS = value; }
// public MLProperties MLProperties => cc.MLProperties;
public MLProviderOrderOutput(string role, string id, IControlComponentProvider provider, IMLControlComponent cc) : base(role, id, provider, cc)
{
this.cc = cc;
......@@ -20,7 +32,7 @@ namespace ControlComponents.ML
if(_running.Status == TaskStatus.WaitingForActivation)
{
cc.MLREWARD = reward;
await cc.StopAndWaitForStopped(Id);
await cc.StopAndWaitForStopped(OwnerId);
await cc.DeselectOperationMode();
}
else
......@@ -47,8 +59,8 @@ namespace ControlComponents.ML
cc.MLOBSERVE = observations;
cc.MLENACT = MLControlComponent.ConvertToMLENACT(actionMask);
await cc.ResetAndWaitForIdle(Id);
await cc.StartAndWaitForExecute(Id);
await cc.ResetAndWaitForIdle(OwnerId);
await cc.StartAndWaitForExecute(OwnerId);
// TODO TIME
await cc.WaitForCompleted(10000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment