#include #include #ifdef ANSI_TERM_SEQUENCES #include #endif #include "data_types.h" #include "model_parameters.h" #include "condensation.h" /* The following routines are model-specific and should be replaced to implement an arbitrary process and observation model. */ void initialise_model_specific_defaults() { /* Set up the parameters of the simulation model, process and observation. */ global.scene.process.mean = SimulatedMean; global.scene.process.scaling = SimulatedScaling; global.scene.process.sigma = SimulatedSigma; global.scene.sigma = SimulatedMeasSigma; /* Set up the parameters of the prior distribution */ global.prior.mean = PriorMean; global.prior.sigma = PriorSigma; /* Set up the parameters of the process model */ global.process.mean = ProcessMean; global.process.scaling = ProcessScaling; global.process.sigma = ProcessSigma; /* Set up the parameters of the observation model */ global.obs.sigma = ObsSigma; /* Set up the parameters of the display model */ global.disp.histogram_width = DisplayWidth; } /* Set up the initial sample-set according to the prior model. The prior is a simple Gaussian, so each of the positions is filled in by sampling that Gaussian and the weights are initialised to be uniform. gaussian_random can be found in utility.c */ void set_up_prior_conditions() { int n; for (n=0; n=0 && which_bin < HistBins) bins[which_bin] += data.sample_weights[n] / data.largest_cumulative_prob; } for (b=0; b= lineheight+1.0) outc = '*'; else if (bins[b] >= lineheight+0.5 && bins[b] < lineheight+1.0) outc = '-'; else if (bins[b] >= lineheight && bins[b] < lineheight+0.5) outc = '_'; else outc = ' '; printf("%c", outc); } printf("\n"); } true_bin = eval_bin(data.meas.true); meas_bin = eval_bin(data.meas.observed); est_bin = eval_bin(estimated_position); for (b=0; b