Created
January 26, 2022 14:08
-
-
Save AurelianTactics/6d53c08e14c9c0cf2e617673280d53db to your computer and use it in GitHub Desktop.
AgentSession snipped
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create world request initializes the environment | |
if( rqo.requestType == DmEnvRpc.V1.EnvironmentRequest.CreateWorldFieldNumber){ | |
// CreateWorld comes in with config settings | |
// in this case just the reset position of the agent | |
int startPosition = 10; | |
// unpack the Tensor format sent in from the grpc | |
if (rqo.unpackedTensorDict.ContainsKey("start_position") ){ | |
if(rqo.unpackedTensorDict["start_position"] != null && rqo.unpackedTensorDict["start_position"].Count > 0) | |
startPosition = rqo.unpackedTensorDict["start_position"][0]; | |
} | |
// tell the enviroment to start with these config settings | |
var startMessage = await StartEnv(startPosition); | |
// generate a response object to send to the communication layer | |
var erObject = MakeEnvironmentResponseObject(rqo.requestType); | |
eroList.Add(erObject); | |
} | |
// later on in the function send the eroList (the list of responses) to the communication layer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment