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

Add ISensor.Update() #2852

Merged
merged 5 commits into from
Nov 6, 2019
Merged

Add ISensor.Update() #2852

merged 5 commits into from
Nov 6, 2019

Conversation

chriselion
Copy link
Contributor

This add an ISensor.Update() method and implements it for the cases where it makes sense. This prevents observations from being cleared before they can be sent to the DemonstrationRecorder.

academyInitializeMethod?.Invoke(aca, new object[] { });

// Step the agent
agent1.RequestDecision();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately this doesn't fail without the fix in place. Might need to discuss a better way to get the test Agent to act like it's in inference mode.

@@ -35,15 +36,16 @@ void Update()
/// <summary>
/// Creates demonstration store for use in recording.
/// </summary>
void InitializeDemoStore()
public void InitializeDemoStore(IFileSystem fileSystem = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Allow for the mock file system to be injected. Could keep this private and do it by reflection, but not sure if that's necessary.

@@ -71,14 +73,22 @@ public void WriteExperience(AgentInfo info)
m_DemoStore.Record(info);
}

public void Close()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this happen on disable instead? Need it for testing to make sure the write stream is flushed,

Copy link
Contributor

Choose a reason for hiding this comment

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

would you move the initialization to OnEnable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's already done lazily in Update()

Copy link
Contributor

Choose a reason for hiding this comment

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

should it be set to null after it's closed? Is there a use case for stopping recording during play mode and resuming?

public DemonstrationStore()
{
m_FileSystem = new FileSystem();
if (fileSystem != null)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Combined these.

Copy link
Contributor

@surfnerd surfnerd left a comment

Choose a reason for hiding this comment

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

Overall looks good. Just unsure of when the demonstration recorder should be open/closed/set to null

@chriselion chriselion merged commit ee82e5f into develop Nov 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the develop-sensor-update branch November 6, 2019 19:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants