from typing import Optional
from typing import Dict
import torch


def sample_linear_trajectories(
    num_cell_types: int,
    seed: Optional[int] = None,
    a_min: float = 0.0,
    a_max: float = 10.0,
    b_min: float = -10.0,
    b_max: float = 10.0,
) -> Dict:
    """
    Generate a sample of linear trajectory coefficients
    
    :param num_cell_types: number of cell types in trajectories
    :param seed: Random seed (for reproducibility)
    :param a_min: minimum value for a coefficient
    :param a_max: maximum values for a coefficient
    :param b_min: minimum value for b coefficient
    :param b_max: maximum value for b coefficient
    
    :return: Dictionary coefficient and their values
    """
    if seed is not None:
        torch.manual_seed(seed)

    # y = ax+b
    a = torch.rand(num_cell_types) * (a_max - a_min) + a_min
    b = torch.rand(num_cell_types) * (b_max - b_min) + b_min

    return {"a": a, "b": b}