import torch


def init_tdl_zeros(batch_size, configuration, device):

    """
    Initialize TDLs with zeros.

    :param batch_size: batch size of inputs and outputs.
    :param configuration: controller configuration
    :param device: device type cpu/gpu
    :return: none
    """

    # CONTROLLER FEEDBACK
    # ---------------------------------------------------------------------------------------
    # Initialize input TDL
    citdl = torch.zeros((batch_size, configuration.controller_input_delay, 1), dtype=torch.float64)
    citdl = citdl.to(device)

    # Initialize reference TDL
    crtdl = torch.zeros((batch_size, configuration.controller_reference_delay, 1), dtype=torch.float64)
    crtdl = crtdl.to(device)

    # Initialize output TDL
    cotdl = torch.zeros((batch_size, configuration.controller_output_delay, 1), dtype=torch.float64)
    cotdl = cotdl.to(device)

    # PLANT FEEDBACK
    # ---------------------------------------------------------------------------------------
    # Initialize input TDL
    pitdl = torch.zeros((batch_size, configuration.plant_input_delay, 1), dtype=torch.float64)
    pitdl = pitdl.to(device)

    # Initialize output TDL
    potdl = torch.zeros((batch_size, configuration.plant_output_delay, 1), dtype=torch.float64)
    potdl = potdl.to(device)

    return citdl, crtdl, cotdl, pitdl, potdl