using AForge;
using System;
//using NPOI.SS.Formula.Functions;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
namespace Hydro.CommonBase
{
[Serializable]
public class CalcExt
{
///
/// 种群数量
///
public int populationNum { get; set; } = 50;
///
/// 搜索深度
///
public int iterationNum { get; set; } = 20;
///
/// 种群数量
///
public int populationNum_full { get; set; } = 50;
///
/// 搜索深度
///
public int iterationNum_full { get; set; } = 20;
///
/// 搜索深度_最小
///
public int iterationNum_Min { get; set; } = 1;
///
/// 线程数
///
public int MaxThread { get; set; } = 4;
///
/// 是否只显示最优解
///
public bool ShowOnlyBest { get; set; } = true;
///
/// 是否优选
///
public bool 是否优选方案 { get; set; } = true;
///
/// 是否优选
///
public bool 启用数据库存储 { get; set; } = false;
///
/// 是否优选
///
public bool 启用内存存储 { get; set; } = false;
///
/// 是否使用新版本保存方式
///
public bool 是否新版本保存 { get; set; } = true;
public bool 是否新版本读取 { get; set; } = true;
public bool 是否枚举 { get; set; } = false;
public bool BreakSearchWhenOver { get; set; } = false;
///
/// 开启水力计算
///
public bool isWaterModelCalc { get; set; } = true;
///
/// 开启水质计算
///
public bool isQualityCalc { get; set; } = false;
///
/// 显示详细日志
///
public bool 显示详细日志 { get; set; } = false;
///
/// 输出运行情况
///
public bool 输出运行情况 { get; set; } = false;
///
/// 输出运行情况
///
public bool 自动发送指令 { get; set; } = false;
///
/// 输出运行情况
///
public string OrderUrl { get; set; } = "";
///
/// 输出运行情况
///
public string AlarmUrl { get; set; } = "";
///
/// 输出运行情况
///
public bool 方案择优 { get; set; } = false;
///
/// 是否水量分配
///
public bool waterdistribute { get; set; } = false;
public bool 本地项目编译 { get; set; } = false;
///
/// 0当量分配;1随机分配;
///
public int waterdistributeMode { get; set; } = 0;
///
/// 分配总水量
///
public float Distribution_TotalDemand { get; set; } = 25;
///
/// 分配总水量是否从小到大计算
///
public bool isDistributionStepCalc { get; set; } = true;
///
/// 分配总水量计算步长
///
public float DistributionCalcStep { get; set; } = 1;
///
/// 每个节点最多分配水量:平均值 * Distribution_OverAvgFactor
///
public double Distribution_OverAvgFactor { get; set; } = 2;
///
/// 当量表
///
public float[] Distribution_UnitDemands { get; set; } =new float[] { 0.36f,0.54f,0.72f };
private string[] ChildSolutions = new string[0];
///
/// 子方案集
///
public Solution[] ChildSolutionArr = new Solution[0];
/////
///// 子方案集线程数量
/////
//public int[] ChildSolutionsThread = new int[0];
///
/// 模型的计算时刻,-1则计算该模型的所有时刻,n则表示计算该模型的第n个时刻(n>=0);
/// 最终会生成影响TimeStep和TimeDuration的值,从而决定PeriodCount的值,实际生效的为PeriodCount
///
public int MultiTimes { get; set; } = 0;
public int EPAPeriodCount { get; set; }
///
/// 程序计算的步长,单位是分钟
///
public int TimeStep;
///
/// 程序计算的总时长,单位是分钟
///
public int TimeDuration;
///
/// 程序的阶段数,即程序计算的总时长/程序计算的步长
///
public int PeriodCount;
///
/// 开始的时间,主要用来显示,单位是分钟
///
public int TimeStart { get; set; }
public string[] Branchs { get; set; }
}
//public class Solution
//{
// public Solution(string f,int n)
// {
// 存储表名=名称 = f;
// 并行数 = n;
// }
// [Category("1、方案信息")]
// [Description("方案名称")]
// [DisplayName("1、方案编码")]
// public string 名称 { get; set; }
// [Category("1、方案信息")]
// [Description("该型号子方案计算器的数量")]
// [DisplayName("3、并行数")]
// public int 并行数 { get; set; }
// [Category("1、方案信息")]
// [Description("启动/禁用")]
// [DisplayName("2、是否启用")]
// public bool 启用 { get; set; }
// [Category("2、存储")]
// [Description("存储/不存储")]
// [DisplayName("2、是否存储")]
// public bool 是否存储 { get; set; }
// [Category("2、存储")]
// [Description("方案的名称,必填;")]
// [DisplayName("1、方案名称")]
// public string 存储表名 { get; set; }
// [Category("2、存储")]
// [Description("文件的存储位置")]
// [DisplayName("3、文件存储位置")]
// public string 存储位置 { get; set; }
// [Category("2、存储")]
// [Description("一组自然数值,表示每一位向量的二进制长度,用“,”隔开")]
// [DisplayName("4、长度组")]
// public string list_Length
// {
// get
// {
// if (settings == null || settings.Length_Ds == null) return null;
// return string.Join(",", settings.Length_Ds);
// }
// set
// {
// try
// {
// if(value==null) return;
// if (settings == null) settings = new SaveSettings();
// settings.Length_Ds = value.Split(',').ToList().Select(n => int.Parse(n)).ToList();
// }
// catch
// {
// }
// }
// }
// [Category("2、存储")]
// [Description("一组Range值,表示每一位向量的范围,举例:1,2|2,3|0.3,0.4")]
// [DisplayName("5、范围组")]
// public string list_Range
// {
// get
// {
// if (settings == null || settings.list_Range == null) return null;
// return string.Join("|", settings.list_Range.Select(n=>$"{n.Min},{n.Max}"));
// }
// set
// {
// try
// {
// if (value == null) return;
// if (settings == null) settings = new SaveSettings();
// settings.list_Range = value.Split('|').ToList().Select(n => new MyDoubleRange(double.Parse( n.Split(',')[0]),double.Parse( n.Split(',')[1]))).ToList();
// }
// catch
// {
// }
// }
// }
// [Category("2、存储")]
// [Description("一组Range值,表示每一位向量的范围,举例:{1,2},{2,3}")]
// [DisplayName("6、闪存设置")]
// [Browsable(false)]
// public SaveSettings settings { get; set; }
//}
}