classdef dlCHOMPDataOptions < matlab.mixin.CustomDisplay
%DLCHOMPDATAOPTIONS Training data generation options for dlCHOMP
%
%   OPTS=dlCHOMPDataOptions returns a data options object, OPTS
%   which can be used with dlCHOMP to generate training data samples
%   for training and validation
%
%   dlCHOMPDataOptions properties:
%       RadiusRangeOfObstacles      - Minimum and maximum radius of
%                                     spherical obstacles generated
%                                     around the robot
%       CountRangeOfObstacles       - Minimum and maximum number of
%                                     spherical obstacles generated
%                                     around the robot
%       MinDistanceFromBase         - Minimum distance from the robot
%                                     base at which to place the
%                                     generated obstacles
%       NumSamples                  - Total number of data samples to
%                                     generate for training and validation
%                                     datasets combined.
%       ValidationSplit             - Percentage of training dataset
%                                     samples to be put into the
%                                     validation dataset
%       RandomStream                - Random stream used to generate
%                                     random numbers
%       Seed                        - Random number seed used to create
%                                     the random stream
%
%   See also chompCollisionOptions, chompSmoothnessOptions,
%   chompSolverOptions
%
%   Example:
%       <To Be Added>
%
%

% Copyright 2023 The MathWorks, Inc.

%#codegen
    properties
        %RadiusRangeOfObstacles Minimum and maximum radius of
        %   spherical obstacles generated around the robot
        %
        % Default: [0.2 0.5]
        RadiusRangeOfObstacles(1,2) double {...
            mustBeInRange(RadiusRangeOfObstacles,0,1),...
            validateattributes(RadiusRangeOfObstacles,{'double'},{'nondecreasing'})}=[0.2 0.5]

        %CountRangeOfObstacles Minimum and maximum number of
        %spherical obstacles generated around the robot
        %
        % Default: [20 30]
        CountRangeOfObstacles(1,2) double {...
            mustBePositive,...
            mustBeInteger,...
            validateattributes(CountRangeOfObstacles,{'double'},{'nondecreasing'})}=[20 30]

        %MinDistanceFromBase Minimum distance from the robot base at which
        %to place the generated obstacles
        %
        % Default: 0.2
        MinDistanceFromBase(1,1) double {...
            mustBeInRange(MinDistanceFromBase,0,1)}=0.2

        %NumSamples Total number of data samples to generate for training
        %and validation datasets combined
        %
        % Default: 2000
        NumSamples(1,1) double {...
            mustBePositive,...
            mustBeInteger}=2000

        %ValidationSplit Percentage of generated data samples to be put
        %into the validation dataset. The rest are put into the training dataset.
        %
        % Default: 0.2
        ValidationSplit(1,1) double {...
            mustBeInRange(ValidationSplit,0,1)}=0.2

        %RandomStream Random stream used to generate random numbers
        %
        % Default: "threefry"
        RandomStream {...
            mustBeMember(RandomStream,{'global','threefry'})}='threefry'

        %Seed Random number seed used to create the random stream
        %
        % Default: 0
        Seed(1,1) double {...
            mustBeNonnegative,...
            mustBeInteger}=0
    end

    methods
        function obj=dlCHOMPDataOptions(nvargs)
        %Constructor
            arguments
                nvargs.RadiusRangeOfObstacles
                nvargs.CountRangeOfObstacles
                nvargs.MinDistanceFromBase
                nvargs.NumSamples
                nvargs.ValidationSplit
                nvargs.RandomStream
                nvargs.Seed
            end
            obj = robotics.core.internal.assignNVArgs(obj,nvargs);
        end
    end

    methods (Access = protected)
        function propgrp = getPropertyGroups(obj)
        %getPropertyGroups Function to display property values
        %   getPropertyGroups(DLCHOMPDATAOPTIONS) Called by super class
        %   to display DLCHOMPDATAOPTIONS object's properties.
        %   This will display the SEED property only when the
        %   "RandomStream" property has a value of "threefry"
            propgrp = getPropertyGroups@matlab.mixin.CustomDisplay(obj);
            if strcmp(obj.RandomStream,"global")
                newproplist = rmfield(propgrp.PropertyList,"Seed");
                propgrp = matlab.mixin.util.PropertyGroup(newproplist);
            end
        end
    end
end
