function [Code_Losses] = Run_Macro_GoodState(Channel_Parameters,Code_Parameters)

struct2var(Channel_Parameters);
struct2var(Code_Parameters);
%Long_Channel_Length = Channel_Parameters.Long_Channel_Length;
%Channel_Length = Channel_Parameters.Channel_Length;
%PeG = Channel_Parameters.PeG;
%MySeed = Channel_Parameters.MySeed;

%MySeed = 10;
%Channel = double(or(preChannel,randsrc(1,Long_Channel_Length,[0 1;1-PeG PeG],MySeed)));
Channel = randsrc(1,Long_Channel_Length,[0 1;1-PeG PeG],MySeed);
%Long_Channel_Length = length(Channel);
%Channel_Length = 10^4;
tic;
for index = 1:Long_Channel_Length/Channel_Length;
    disp(['Chunck# ' num2str(index) '/' num2str(Long_Channel_Length/Channel_Length)]);
    Ch = Channel((index-1)*Channel_Length+1:index*Channel_Length);
    % Macro-Code
    Dec_Channel_Macro = Macro_Code_Decoder(x,u,n,0,M,T,Ch);
    Dec_Channel_Macro = [Dec_Channel_Macro zeros(1,M-mod(length(Dec_Channel_Macro),M))];
    Lost_Macro_Macros = sum(reshape(Dec_Channel_Macro,M,length(Dec_Channel_Macro)/M));
    Lost_Macro_Macros = (Lost_Macro_Macros ~= 0);
    preLosses_Macro(index) = sum(Lost_Macro_Macros);
    % Macro-Robust-Code
    [delays_Macro,delays_u,delays_n] = Macro_Optimal_Decoder(x,u,k,M,T,Ch);
    preLosses_MacroRobust(index) = sum(delays_Macro > T);
    % RLC
    delays_RLC = Macro_RLC_Decoder(R,M,T,Ch);
    Lost_RLC = delays_RLC>T;
    Lost_RLC = [Lost_RLC zeros(1,M-mod(length(Lost_RLC),M))];
    Lost_RLC_Macros = sum(reshape(Lost_RLC,M,length(Lost_RLC)/M));
    Lost_RLC_Macros = (Lost_RLC_Macros ~= 0);
    preLosses_RLC(index) = sum((Lost_RLC_Macros));
    % SCo Code
    Dec_Channel_SCo = SCo_Decoder(B_SCo,M*T,Ch);
    Dec_Channel_SCo = [Dec_Channel_SCo zeros(1,M-mod(length(Dec_Channel_SCo),M))];
    Lost_SCo_Macros = sum(reshape(Dec_Channel_SCo,M,length(Dec_Channel_SCo)/M));
    Lost_SCo_Macros = (Lost_SCo_Macros ~= 0);
    preLosses_SCo(index) = sum(Lost_SCo_Macros);
    % SCo MDP (Macro)
    %Dec_Channel_SCoMDP = Macro_SCoMDP_Decoder(b,T-b,M,T,Ch);
    %Dec_Channel_SCoMDP = [Dec_Channel_SCoMDP zeros(1,M-mod(length(Dec_Channel_SCoMDP),M))];
    %Lost_SCoMDP_Macros = sum(reshape(Dec_Channel_SCoMDP,M,length(Dec_Channel_SCoMDP)/M));
    %Lost_SCoMDP_Macros = (Lost_SCoMDP_Macros ~= 0);
    %preLosses_SCoMDP(index) = sum(Lost_SCoMDP_Macros);
    preLosses_SCoMDP(index) = 0;
    
    disp(['Uncoded = ' num2str(sum(Ch))]);
    disp(['Macro = ' num2str(sum(preLosses_Macro))]);
    disp(['Macro (Robust) = ' num2str(sum(preLosses_MacroRobust))]);
    disp(['RLC = ' num2str(sum(preLosses_RLC))]);
    disp(['SCo = ' num2str(sum(preLosses_SCo))]);
    disp(['SCo (MDP) = ' num2str(sum(preLosses_SCoMDP))]);
    disp('===========================================')
    toc
    tic;
end
Losses_Macro = sum(preLosses_Macro);
Losses_MacroRobust = sum(preLosses_MacroRobust);
Losses_RLC = sum(preLosses_RLC);
Losses_SCo = sum(preLosses_SCo);
Losses_SCoMDP = sum(preLosses_SCoMDP);
Losses_Uncoded = 0;

Code_Losses = var2struct(Losses_Uncoded,Losses_Macro,Losses_MacroRobust,Losses_RLC,Losses_SCo,Losses_SCoMDP);
%save(Filename_Data,Losses_Macro_Good,Losses_MacroRobust_Good,Losses_RLC_Good,Losses_SCo_Good,Losses_SCoMDP_Good);