% This function is part of the NMSM Pipeline, see file for full license.
%
% This function tracks the difference between the predicted step time
% asymmetry and the error center specified. An error center of "1" would
% encourage step time symmetry.
%
% (struct, struct, struct, struct) -> (Array of number)
%
function cost = calcStepTimeAsymmetryIntegrand(values, ...
modeledValues, params, costTerm)
errorCenter = valueOrAlternate(costTerm, "errorCenter", 1);
stepTimeAsymmetry = calcStepTimeAsymmetry(values, ...
modeledValues, params);
cost = calcTrackingCostArrayTerm(stepTimeAsymmetry * ...
ones(length(values.time), 1), errorCenter * ...
ones(length(values.time), 1), 1);
end