% x13 - data setup for 1 set of 3 measurements

if( K == 1)

  LOADED = 13;

  N = 1;			% N data samples

% set up main global variables
%
  false_alarm_rate = 2;		% average number of false alarms per unit time

  Pmiss = 0.2;			% probability of a missed target event

  MM = 3;

  MM_max = 3;

  M = MM_max + 1;			% M states

  XY_offset = 0;			% XY measurement offset indices

% apriori costs for missed target events
%
% Cmiss(n+1,K) is -log( P(n target events)) apriori cost
%
  Cmiss = get_Cmiss( Pmiss, MM_max);

% apriori costs for false detections
%
% Cfalse(m+1) is -log(P(m false detections))

  Cfalse = get_Cfalse( false_alarm_rate, MM_max);

% generate XY measurements
%
  dt = 4/20;				% needed in Kalman gain computation

  XY = zeros(2,3);

  XY(:,1) = [ 1; 1];
  XY(:,2) = [ 2; 2];
  XY(:,3) = [ 3; 3];

  Kn = 0.01;				% measurement noise variance

  missed_cost = log(16);		% volume is x,y = 0..4,0..4

  zstate = 0;	% initial state unknown

  z = [1:N];	% time index for dummy z data

else % K > 1

  if( LOADED ~= 13)
    error( 'initialize with K = 1 first');
  end

  if( K > MM_max)
    error( 'K > MM_max not allowed!');
  end

  setup_combos;	% setup global variables: perms, combos, unique_perms, MP, M

end
