| | |
| | | return 0; |
| | | } |
| | | return host.Id; |
| | | |
| | | |
| | | } |
| | | public void UpdateByOldVersion() |
| | | { |
| | |
| | | { |
| | | return ExpressionType; |
| | | } |
| | | else if (ExpressionType == "∈")//试算参数 |
| | | { |
| | | string express = Expression; |
| | | if (Ext.doubleRange!=null) |
| | | { |
| | | var arr = new double[] { Ext.doubleRange.Min, Ext.doubleRange.Max }; |
| | | express = string.Join(",", arr); |
| | | } |
| | | return $"{{{ModelObjectID}}}{ExpressionType}[{express}] ▲{accurary}" ; |
| | | } |
| | | else |
| | | { |
| | | return $"{ExpressionType} " + (ExpressionType == "∈" ? $"[{Expression}] ▲{accurary}" : (ExpressionType == "最小" || ExpressionType == "最大" ? $"| 容许范围[{Expression}]" : Expression)); |
| | |
| | | int 小数位数 = Ext.小数位数; |
| | | if (Ext.ResultShowType==0) |
| | | { |
| | | |
| | | |
| | | |
| | | if (LogicType=="试算参数" ) |
| | | if (LogicType == "目标函数") |
| | | { |
| | | result = $"[{getFormat(Math.Round(Ext.Result_Arr.Sum(), 小数位数))}] {getFormat(Math.Round(Ext.Result_Arr[Ext.Period], 小数位数))}" ; |
| | | } |
| | | else if (LogicType=="试算参数" ) |
| | | { |
| | | try |
| | | { |
| | | var arr = Expression.Split(',').Select(v => Convert.ToDouble(v)).ToArray(); |
| | | var arr = new double[] {Ext.doubleRange.Min,Ext.doubleRange.Max };// Expression.Split(',').Select(v => Convert.ToDouble(v)).ToArray(); |
| | | var range = new DRange(arr[0], arr[1]); |
| | | var accuracy = double.Parse(accurary); |
| | | result = getFormat(getRoundByAccuracy(Ext.Result_Arr[Ext.Period], range,accuracy)); |
| | | result = getFormat(getRoundByAccuracy(Ext.Result_Arr[0], range,accuracy)); |
| | | } |
| | | catch |
| | | { |
| | | result = "-"; |
| | | } |
| | | |
| | | } |
| | | else |
| | | if ( Ext.Result_Arr.Length> Ext.Period && !double.IsNaN( Ext.Result_Arr[Ext.Period])) |
| | | else if ( Ext.Result_Arr.Length> Ext.Period && !double.IsNaN( Ext.Result_Arr[Ext.Period])) |
| | | { |
| | | result= getFormat(Math.Round(Ext.Result_Arr[Ext.Period],小数位数)); |
| | | } |
| | |
| | | if (txt.Length > LengthLimit) txt = txt.Substring(0, LengthLimit) + "..."; |
| | | result= txt; |
| | | } |
| | | |
| | | if (Ext.bestObj!=null) |
| | | { |
| | | result += Ext.bestObj; |
| | | } |
| | | return result; |
| | | |
| | | } |
| | | } |
| | | private double getRoundByAccuracy(double v, DRange range, double accuracy) |