|
|
|
|
|
|
|
|
|
|
[Range(1, 50)] public int numStackedVectorObservations = 1; |
|
|
|
|
|
|
|
public int[] vectorActionSize = new int[1]{1}; |
|
|
|
public int[] vectorActionSize = new int[1] {1}; |
|
|
|
/**< \brief If continuous : The length of the float vector that represents |
|
|
|
* the action |
|
|
|
* <br> If discrete : The number of possible values the action can take*/ |
|
|
|
|
|
|
|
|
|
|
public SpaceType vectorActionSpaceType = SpaceType.discrete; |
|
|
|
/**< \brief Defines if the action is discrete or continuous */ |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Converts a Brain into to a Protobuff BrainInfoProto so it can be sent
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
public CommunicatorObjects.BrainParametersProto |
|
|
|
public CommunicatorObjects.BrainParametersProto |
|
|
|
ToProto(string name, bool isTraining) |
|
|
|
{ |
|
|
|
var brainParametersProto = new CommunicatorObjects.BrainParametersProto |
|
|
|
|
|
|
VectorActionSize = {vectorActionSize}, |
|
|
|
VectorActionSpaceType = |
|
|
|
(CommunicatorObjects.SpaceTypeProto)vectorActionSpaceType, |
|
|
|
(CommunicatorObjects.SpaceTypeProto) vectorActionSpaceType, |
|
|
|
BrainName = name, |
|
|
|
IsTraining = isTraining |
|
|
|
}; |
|
|
|
|
|
|
GrayScale = res.blackAndWhite |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Converts Resolution protobuf array to C# Resolution array.
|
|
|
|
/// </summary>
|
|
|
|
private static Resolution[] ResolutionProtoToNative( |
|
|
|
CommunicatorObjects.ResolutionProto[] resolutionProtos) |
|
|
|
{ |
|
|
|
var localCameraResolutions = new Resolution[resolutionProtos.Length]; |
|
|
|
for (var i = 0; i < resolutionProtos.Length; i++) |
|
|
|
{ |
|
|
|
localCameraResolutions[i] = new Resolution |
|
|
|
{ |
|
|
|
height = resolutionProtos[i].Height, |
|
|
|
width = resolutionProtos[i].Width, |
|
|
|
blackAndWhite = resolutionProtos[i].GrayScale |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
return localCameraResolutions; |
|
|
|
cameraResolutions = ResolutionProtoToNative( |
|
|
|
brainParametersProto.CameraResolutions.ToArray() |
|
|
|
); |
|
|
|
vectorActionSpaceType = (SpaceType)brainParametersProto.VectorActionSpaceType; |
|
|
|
vectorActionSpaceType = (SpaceType) brainParametersProto.VectorActionSpaceType; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|