package com.example.demo.model;

import com.example.demo.model.enums.SchemeStatus;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 任务方案实体模型。
 * <p>
 * 表示经过任务规划引擎生成的作战任务方案，
 * 包含兵力部署、行动路线、时间节点等详细信息。
 * </p>
 */
public class TaskScheme {

    /** 方案唯一标识 */
    private String schemeId;

    /** 方案名称 */
    private String schemeName;

    /** 方案类型：集中式/分布式 */
    private String schemeType;

    /** 关联事件ID */
    private String eventId;

    /** 关联任务草案ID */
    private String draftId;

    /** 方案状态 */
    private SchemeStatus status;

    /** 方案优先级（1-10，数值越高优先级越高） */
    private int priority;

    /** 预计耗时（分钟） */
    private int estimatedDuration;

    /** 预计战损比（0.0~1.0） */
    private double estimatedLossRatio;

    /** 方案成功率（0.0~1.0） */
    private double successRate;

    /** 兵力部署详情（JSON格式） */
    private String deploymentDetail;

    /** 行动路线（JSON格式） */
    private String routeDetail;

    /** 时间节点（JSON格式） */
    private String timelineDetail;

    /** 算法溯源信息（AI生成路径、优化过程） */
    private String algorithmTrace;

    /** 父方案ID（重构时关联旧版本） */
    private String parentSchemeId;

    /** 版本号 */
    private int version;

    /** 执行进度百分比（0~100） */
    private int executionProgress;

    /** 子任务状态列表（JSON格式） */
    private String subTaskStatus;

    /** 创建时间 */
    private LocalDateTime createTime;

    /** 更新时间 */
    private LocalDateTime updateTime;

    public TaskScheme() {
    }

    public TaskScheme(String schemeId, String schemeName, String schemeType,
                      SchemeStatus status, int priority, int estimatedDuration,
                      double estimatedLossRatio, double successRate) {
        this.schemeId = schemeId;
        this.schemeName = schemeName;
        this.schemeType = schemeType;
        this.status = status;
        this.priority = priority;
        this.estimatedDuration = estimatedDuration;
        this.estimatedLossRatio = estimatedLossRatio;
        this.successRate = successRate;
        this.version = 1;
        this.executionProgress = 0;
        this.createTime = LocalDateTime.now();
        this.updateTime = LocalDateTime.now();
    }

    public String getSchemeId() {
        return schemeId;
    }

    public void setSchemeId(String schemeId) {
        this.schemeId = schemeId;
    }

    public String getSchemeName() {
        return schemeName;
    }

    public void setSchemeName(String schemeName) {
        this.schemeName = schemeName;
    }

    public String getSchemeType() {
        return schemeType;
    }

    public void setSchemeType(String schemeType) {
        this.schemeType = schemeType;
    }

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public String getDraftId() {
        return draftId;
    }

    public void setDraftId(String draftId) {
        this.draftId = draftId;
    }

    public SchemeStatus getStatus() {
        return status;
    }

    public void setStatus(SchemeStatus status) {
        this.status = status;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public int getEstimatedDuration() {
        return estimatedDuration;
    }

    public void setEstimatedDuration(int estimatedDuration) {
        this.estimatedDuration = estimatedDuration;
    }

    public double getEstimatedLossRatio() {
        return estimatedLossRatio;
    }

    public void setEstimatedLossRatio(double estimatedLossRatio) {
        this.estimatedLossRatio = estimatedLossRatio;
    }

    public double getSuccessRate() {
        return successRate;
    }

    public void setSuccessRate(double successRate) {
        this.successRate = successRate;
    }

    public String getDeploymentDetail() {
        return deploymentDetail;
    }

    public void setDeploymentDetail(String deploymentDetail) {
        this.deploymentDetail = deploymentDetail;
    }

    public String getRouteDetail() {
        return routeDetail;
    }

    public void setRouteDetail(String routeDetail) {
        this.routeDetail = routeDetail;
    }

    public String getTimelineDetail() {
        return timelineDetail;
    }

    public void setTimelineDetail(String timelineDetail) {
        this.timelineDetail = timelineDetail;
    }

    public String getAlgorithmTrace() {
        return algorithmTrace;
    }

    public void setAlgorithmTrace(String algorithmTrace) {
        this.algorithmTrace = algorithmTrace;
    }

    public String getParentSchemeId() {
        return parentSchemeId;
    }

    public void setParentSchemeId(String parentSchemeId) {
        this.parentSchemeId = parentSchemeId;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public int getExecutionProgress() {
        return executionProgress;
    }

    public void setExecutionProgress(int executionProgress) {
        this.executionProgress = executionProgress;
    }

    public String getSubTaskStatus() {
        return subTaskStatus;
    }

    public void setSubTaskStatus(String subTaskStatus) {
        this.subTaskStatus = subTaskStatus;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}
