%

% Copyright 2017-2018 The MathWorks, Inc.
classdef Simulation < xls.internal.ObjBase
    properties (Dependent, SetAccess = private)
        Index (1,1) int32;
        FcnCallStartCol (1,1) int32;
        FcnCallStopCol (1,1) int32;
        StartCol (1,1) int32;
        StopCol (1,1) int32;
    end

    methods
        function obj = Simulation(id)
            if nargin == 0
                id = 0;
            end
            obj = obj@xls.internal.ObjBase(id);
        end

        function ret = get.Index(obj)
            ret = xls.internal.getSimulationProperty(obj.id, 'Index');
        end

        function ret = get.FcnCallStartCol(obj)
            ret = xls.internal.getSimulationProperty(obj.id, 'FcnCallStartCol') + 1; % 1-indexed
        end

        function ret = get.FcnCallStopCol(obj)
            ret = xls.internal.getSimulationProperty(obj.id, 'FcnCallStopCol') + 1; % 1-indexed
        end

        function ret = get.StartCol(obj)
            ret = xls.internal.getSimulationProperty(obj.id, 'StartCol') + 1; % 1-indexed
        end

        function ret = get.StopCol(obj)
            ret = xls.internal.getSimulationProperty(obj.id, 'StopCol') + 1; % 1-indexed
        end

        function range = getRange(obj)
            id = xls.internal.getSimulationProperty(obj.id, 'Range');
            range = xls.internal.Range(id);
        end

        function ret = getParametersRange(obj)
            id = xls.internal.getSimulationProperty(obj.id, 'xls.ParametersRange');
            if id > 0
                ret = xls.internal.ParametersRange(id);
            else
                ret = xls.internal.ParametersRange.empty;
            end
        end

        sources = getSources(obj, sourceType);
    end
end
