You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dotsStimulus.m
    path of file: ./repos/opticka/stimuli
    
    the code of the file until where you have to start completion: % ========================================================================
%> @brief dotsStimulus simple variable coherence dots stimulus, inherits from baseStimulus
%>
%>
%>
%> Copyright ©2014-2022 Ian Max And
    
function reset(me)
			me.removeTmpProperties;
			if me.wasMaskColourBlank;me.maskColour=[];end
			me.wasMaskColourBlank=false;
			me.angles = [];
			me.xy = [];
			me.dxs = [];
			me.dys = [];
			me.dxdy = [];
			me.colours = [];
			resetTicks(me);
		end
		
		% ===================================================================
		%> @brief density set method
		%>
		%> We need to update nDots if density is changed
		% ===================================================================
		function set.density(me,value)
			me.density = value;
			me.nDots; %#ok<MCSUP>
		end
		
		% ===================================================================
		%> @brief nDots is dependant property, this get method also caches
		%> the value in me.nDots_ fo speed
		%>
		% ===================================================================
		function value = get.nDots(me)
			if ~me.inSetup && isprop(me,'sizeOut')
				sz = me.sizeOut + me.maskSmoothing - (me.dotSizeOut*1.5);
				me.nDots_ = round(me.densityOut * (sz/me.ppd)^2);
			else
				me.nDots_ = round(me.density * me.size^2);
			end