Demo of agent_choice.
%this function implements the call sequence. it can be random, or depend %on timestep explicitly. the syntax is %function [agent_number] = agent_choice(ts,pos_vec,state_vec); %where ts = timestep, a positive integer, and pos_vec and state_vec define %a configuration pos_vec = [1 4 7 8 10 11]; %the output of the function is agent_number, the name of the agent being %called. %one version of this function is: n = length(pos_vec) %this computes the number of agents agent_number = ceil(rand*n) %this function represents random agent choice taken from a uniform distribution
n = 6 agent_number = 6