Asoka.Wang 21f044712c 1
2025-08-27 18:39:19 +08:00

60 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using NPP.SmartSchedue.Api.Contracts.Domain.Personnel;
using NPP.SmartSchedue.Api.Contracts.Domain.Work;
using NPP.SmartSchedue.Api.Contracts.Services.Integration.Input;
using NPP.SmartSchedue.Api.Contracts.Services.Integration.Output;
namespace NPP.SmartSchedue.Api.Contracts.Services.Integration.Models;
public class AllocationContext
{
public AllocationContext()
{
// 初始化所有集合属性,避免空引用异常
WorkOrders = new List<WorkOrderEntity>();
WeightConfiguration = new Dictionary<string, double>();
AvailablePersonnel = new List<PersonnelEntity>();
ProcessingLog = new List<string>();
Errors = new List<string>();
ConstraintResults = new Dictionary<long, List<ConstraintEvaluationResult>>();
FilteredCandidates = new Dictionary<long, List<PersonnelCandidate>>();
Metrics = new Dictionary<string, object>();
OptimizationResults = new Dictionary<long, List<OptimizationScoreResult>>();
}
public string ContextId { get; set; }
public DateTime CreatedAt { get; set; }
public List<WorkOrderEntity> WorkOrders { get; set; }
public PersonnelAllocationStrategy Strategy { get; set; }
public Dictionary<string, double> WeightConfiguration { get; set; }
public List<PersonnelEntity> AvailablePersonnel { get; set; }
public List<string> ProcessingLog { get; set; }
public List<string> Errors { get; set; }
public Dictionary<long, List<ConstraintEvaluationResult>> ConstraintResults { get; set; }
public Dictionary<long, List<PersonnelCandidate>> FilteredCandidates { get; set; }
/// <summary>
/// 性能指标字典
/// 存储分配过程中各阶段的性能数据,如执行时间、处理数量等
/// Key: 指标名称Value: 指标值
/// </summary>
public Dictionary<string, object> Metrics { get; set; }
/// <summary>
/// 优化决策结果字典
/// 存储每个工作任务的优化决策详细结果
/// Key: 工作任务ID, Value: 优化评分结果列表
/// </summary>
public Dictionary<long, List<OptimizationScoreResult>> OptimizationResults { get; set; }
}