@classmethod
def from_task(cls, task, current_time):
    """Constructs a TaskSample from a task

        Args:
            task (Task): The task to sample
            current_time (datetime): The current datetime used to sample the task

        Returns:
            TaskSample: The constructed sample
        """
    return cls(task.get_duration_sample(current_time), task.
        get_earliest_start_sample(current_time), task.
        get_latest_finish_sample())
