NumOfActors
(read only)
This property returns the number of Actors created so far.
Example
% Create DSS object
DSSObject = actxserver('OpenDSSEngine.DSS')
if ~DSSObject.Start(0),
disp('Unable to start openDSS');
return
end;
DSSText = DSSObject.Text;
DSSCircuit = DSSObject.ActiveCircuit;
% Handler for Parallel processing functions
DSSParallel = DSSCircuit.Parallel;
% Gets the number of CPUs this PC has
CPUs = DSSParallel.NumCPUs;
% By default one actor is created, if you want more than one
% parallel instance you will have to create them. Try to leave at least
% One CPU available to handle the rest of windows, otherwise will block everything
disp('Creating Actors');
DSSText.Command = 'compile "C:\Program Files\OpenDSS\EPRITestCircuits\ckt5\Master_ckt5.DSS"';
DSSText.Command = 'set maxiterations=1000 maxcontroliter=1000'; % Just in case
DSSCircuit.Solution.Solve(); % Solves Actor 1
DSSText.Command = ['Clone ',int2str(CPUs-2)]; %Creates the other actors
DSSText.Command = 'set ActiveActor=*'; %activates all actors to send commands concurrently
DSSText.Command = 'set mode=Time stepsize=1h number=16000';
%Gets the number of actors created so far
myNActors = DSSParallel.NumActors;