function [A,B,C,D] = pfcblock_utilGetDTModelNoLagForMPCHasSpacingCtrl(Ts,Vx,Ag,Bg,Cg)
%#codegen
%
% Get discrete state-space model for Adaptive MPC. Called by the "Path
% Following Control System" Block. This function is called when "Spacing
% control" is enabled.

% Inputs:
%   Ts:                mask variable for sample time
%   Vx:                mask inport for longitudinal velocity
%   Ag,Bg,Cg:          continuous or discrete vehicle model with sample time Ts        
% Outputs:
%   A,B,C,D:           discrete time model for MPC

%   Author: Meng Xia, Rong Chen
%   Copyright 2017-2021 The MathWorks, Inc.


%% Augment vehicle model to MPC model (lag free)
[As,Bs,Cs,Ds] = pfcblock_utilAugmentVehicleMdlHasSpacingCtrl(Ag,Bg,Cg,Vx);
%% Discretize model with sample time Ts
[A, B] = adasblocks_utilDicretizeModel(As, Bs, Ts);
C = Cs;
D = Ds;


