diff --git a/VECTO/GUI/HybridStrategyParamsForm.Designer.vb b/VECTO/GUI/HybridStrategyParamsForm.Designer.vb index f10472531a2b3e5b90d3d2eb94de381302ac3ac4..995fc66fe3c561090bb213771f6725d9f8f6bedb 100644 --- a/VECTO/GUI/HybridStrategyParamsForm.Designer.vb +++ b/VECTO/GUI/HybridStrategyParamsForm.Designer.vb @@ -87,10 +87,14 @@ Partial Class HybridStrategyParamsForm Me.EquivalenceFactorChg = New System.Windows.Forms.Label() Me.lblEquivFactorChargeUnit = New System.Windows.Forms.Label() Me.tbEquivalenceFactorCharge = New System.Windows.Forms.TextBox() - Me.Panel3 = New System.Windows.Forms.Panel() + Me.pnICEStartPenaltyFactor = New System.Windows.Forms.Panel() Me.lblICEStartPenaltyFactor = New System.Windows.Forms.Label() Me.lblICEStartPenaltyFactorUnit = New System.Windows.Forms.Label() Me.tbICEStartPenaltyFactor = New System.Windows.Forms.TextBox() + Me.pnCostFactorSoCExponent = New System.Windows.Forms.Panel() + Me.lblCostFactorSoCExponent = New System.Windows.Forms.Label() + Me.lblCostFactorSoCExponentUnit = New System.Windows.Forms.Label() + Me.tbCostFactorSoCExponent = New System.Windows.Forms.TextBox() Me.ToolStrip1.SuspendLayout Me.StatusStrip1.SuspendLayout CType(Me.PictureBox1,System.ComponentModel.ISupportInitialize).BeginInit @@ -103,7 +107,8 @@ Partial Class HybridStrategyParamsForm Me.pnAuxBufferChgTime.SuspendLayout Me.Panel1.SuspendLayout Me.Panel2.SuspendLayout - Me.Panel3.SuspendLayout + Me.pnICEStartPenaltyFactor.SuspendLayout + Me.pnCostFactorSoCExponent.SuspendLayout Me.SuspendLayout ' 'tbEquivalenceFactorDischarge @@ -135,7 +140,7 @@ Partial Class HybridStrategyParamsForm ' Me.ButCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) Me.ButCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.ButCancel.Location = New System.Drawing.Point(362, 355) + Me.ButCancel.Location = New System.Drawing.Point(362, 381) Me.ButCancel.Name = "ButCancel" Me.ButCancel.Size = New System.Drawing.Size(75, 23) Me.ButCancel.TabIndex = 13 @@ -145,7 +150,7 @@ Partial Class HybridStrategyParamsForm 'ButOK ' Me.ButOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles) - Me.ButOK.Location = New System.Drawing.Point(281, 355) + Me.ButOK.Location = New System.Drawing.Point(281, 381) Me.ButOK.Name = "ButOK" Me.ButOK.Size = New System.Drawing.Size(75, 23) Me.ButOK.TabIndex = 12 @@ -234,7 +239,7 @@ Partial Class HybridStrategyParamsForm 'StatusStrip1 ' Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.LbStatus}) - Me.StatusStrip1.Location = New System.Drawing.Point(0, 381) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 407) Me.StatusStrip1.Name = "StatusStrip1" Me.StatusStrip1.Size = New System.Drawing.Size(449, 22) Me.StatusStrip1.SizingGrip = false @@ -541,15 +546,15 @@ Partial Class HybridStrategyParamsForm Me.tbEquivalenceFactorCharge.Size = New System.Drawing.Size(57, 20) Me.tbEquivalenceFactorCharge.TabIndex = 3 ' - 'Panel3 + 'pnICEStartPenaltyFactor ' - Me.Panel3.Controls.Add(Me.lblICEStartPenaltyFactor) - Me.Panel3.Controls.Add(Me.lblICEStartPenaltyFactorUnit) - Me.Panel3.Controls.Add(Me.tbICEStartPenaltyFactor) - Me.Panel3.Location = New System.Drawing.Point(12, 314) - Me.Panel3.Name = "Panel3" - Me.Panel3.Size = New System.Drawing.Size(288, 28) - Me.Panel3.TabIndex = 30 + Me.pnICEStartPenaltyFactor.Controls.Add(Me.lblICEStartPenaltyFactor) + Me.pnICEStartPenaltyFactor.Controls.Add(Me.lblICEStartPenaltyFactorUnit) + Me.pnICEStartPenaltyFactor.Controls.Add(Me.tbICEStartPenaltyFactor) + Me.pnICEStartPenaltyFactor.Location = New System.Drawing.Point(12, 314) + Me.pnICEStartPenaltyFactor.Name = "pnICEStartPenaltyFactor" + Me.pnICEStartPenaltyFactor.Size = New System.Drawing.Size(288, 28) + Me.pnICEStartPenaltyFactor.TabIndex = 30 ' 'lblICEStartPenaltyFactor ' @@ -576,14 +581,50 @@ Partial Class HybridStrategyParamsForm Me.tbICEStartPenaltyFactor.Size = New System.Drawing.Size(57, 20) Me.tbICEStartPenaltyFactor.TabIndex = 3 ' + 'pnCostFactorSoCExponent + ' + Me.pnCostFactorSoCExponent.Controls.Add(Me.lblCostFactorSoCExponent) + Me.pnCostFactorSoCExponent.Controls.Add(Me.lblCostFactorSoCExponentUnit) + Me.pnCostFactorSoCExponent.Controls.Add(Me.tbCostFactorSoCExponent) + Me.pnCostFactorSoCExponent.Location = New System.Drawing.Point(12, 344) + Me.pnCostFactorSoCExponent.Name = "pnCostFactorSoCExponent" + Me.pnCostFactorSoCExponent.Size = New System.Drawing.Size(288, 28) + Me.pnCostFactorSoCExponent.TabIndex = 31 + ' + 'lblCostFactorSoCExponent + ' + Me.lblCostFactorSoCExponent.AutoSize = true + Me.lblCostFactorSoCExponent.Location = New System.Drawing.Point(3, 7) + Me.lblCostFactorSoCExponent.Name = "lblCostFactorSoCExponent" + Me.lblCostFactorSoCExponent.Size = New System.Drawing.Size(132, 13) + Me.lblCostFactorSoCExponent.TabIndex = 0 + Me.lblCostFactorSoCExponent.Text = "Cost Factor SoC Exponent" + ' + 'lblCostFactorSoCExponentUnit + ' + Me.lblCostFactorSoCExponentUnit.AutoSize = true + Me.lblCostFactorSoCExponentUnit.Location = New System.Drawing.Point(244, 7) + Me.lblCostFactorSoCExponentUnit.Name = "lblCostFactorSoCExponentUnit" + Me.lblCostFactorSoCExponentUnit.Size = New System.Drawing.Size(16, 13) + Me.lblCostFactorSoCExponentUnit.TabIndex = 24 + Me.lblCostFactorSoCExponentUnit.Text = "[-]" + ' + 'tbCostFactorSoCExponent + ' + Me.tbCostFactorSoCExponent.Location = New System.Drawing.Point(181, 4) + Me.tbCostFactorSoCExponent.Name = "tbCostFactorSoCExponent" + Me.tbCostFactorSoCExponent.Size = New System.Drawing.Size(57, 20) + Me.tbCostFactorSoCExponent.TabIndex = 3 + ' 'HybridStrategyParamsForm ' Me.AcceptButton = Me.ButOK Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.ButCancel - Me.ClientSize = New System.Drawing.Size(449, 403) - Me.Controls.Add(Me.Panel3) + Me.ClientSize = New System.Drawing.Size(449, 429) + Me.Controls.Add(Me.pnCostFactorSoCExponent) + Me.Controls.Add(Me.pnICEStartPenaltyFactor) Me.Controls.Add(Me.Panel2) Me.Controls.Add(Me.Panel1) Me.Controls.Add(Me.pnAuxBufferChgTime) @@ -627,8 +668,10 @@ Partial Class HybridStrategyParamsForm Me.Panel1.PerformLayout Me.Panel2.ResumeLayout(false) Me.Panel2.PerformLayout - Me.Panel3.ResumeLayout(false) - Me.Panel3.PerformLayout + Me.pnICEStartPenaltyFactor.ResumeLayout(false) + Me.pnICEStartPenaltyFactor.PerformLayout + Me.pnCostFactorSoCExponent.ResumeLayout(false) + Me.pnCostFactorSoCExponent.PerformLayout Me.ResumeLayout(false) Me.PerformLayout @@ -683,8 +726,12 @@ End Sub Friend WithEvents EquivalenceFactorChg As Label Friend WithEvents lblEquivFactorChargeUnit As Label Friend WithEvents tbEquivalenceFactorCharge As TextBox - Friend WithEvents Panel3 As Panel + Friend WithEvents pnICEStartPenaltyFactor As Panel Friend WithEvents lblICEStartPenaltyFactor As Label Friend WithEvents lblICEStartPenaltyFactorUnit As Label Friend WithEvents tbICEStartPenaltyFactor As TextBox + Friend WithEvents pnCostFactorSoCExponent As Panel + Friend WithEvents lblCostFactorSoCExponent As Label + Friend WithEvents lblCostFactorSoCExponentUnit As Label + Friend WithEvents tbCostFactorSoCExponent As TextBox End Class diff --git a/VECTO/GUI/HybridStrategyParamsForm.vb b/VECTO/GUI/HybridStrategyParamsForm.vb index 75aef57a63895981df0a49c6a3c4c379c4b86b51..f7f00c57e19c374dc464c2490f7e8b77798fbc81 100644 --- a/VECTO/GUI/HybridStrategyParamsForm.vb +++ b/VECTO/GUI/HybridStrategyParamsForm.vb @@ -187,6 +187,7 @@ Public Class HybridStrategyParamsForm tbMinICEOnTime.Text = strategyParams.MinimumICEOnTime.ToGUIFormat() tbICEStartPenaltyFactor.Text = strategyParams.ICEStartPenaltyFactor.ToGUIFormat() + tbCostFactorSoCExponent.Text = if(Double.IsNaN(strategyParams.CostFactorSOCExpponent), 5, strategyParams.CostFactorSOCExpponent).ToGUIFormat() DeclInit() REESSFileBrowser.UpdateHistory(file) @@ -228,6 +229,7 @@ Public Class HybridStrategyParamsForm strategyParams.AuxiliaryBufferTime = tbauxBufferTime.Text.ToDouble(0) strategyParams.AuxiliaryBufferChgTime = tbAuxBufferChargeTime.Text.ToDouble(0) strategyParams.ICEStartPenaltyFactor = tbICEStartPenaltyFactor.Text.ToDouble() + strategyParams.CostFactorSOCExpponent = tbCostFactorSoCExponent.Text.ToDouble(5) If Not strategyParams.SaveFile Then MsgBox("Cannot save to " & file, MsgBoxStyle.Critical) @@ -359,6 +361,18 @@ Public Class HybridStrategyParamsForm Change() End Sub + Private Sub Panel4_Paint(sender As Object, e As PaintEventArgs) Handles pnCostFactorSoCExponent.Paint + + End Sub + + Private Sub tbICEStartPenaltyFactor_TextChanged(sender As Object, e As EventArgs) Handles tbICEStartPenaltyFactor.TextChanged + Change() + End Sub + + Private Sub tbCostFactorSoCExponent_TextChanged(sender As Object, e As EventArgs) Handles tbCostFactorSoCExponent.TextChanged + Change() + End Sub + #End Region diff --git a/VECTO/Input Files/HybridStrategyParams.vb b/VECTO/Input Files/HybridStrategyParams.vb index 5597be7dd9e054effac46b1af7f36e2653e295c7..a7dae0588f99a6e0f714445d82c790bd8f4b7ec3 100644 --- a/VECTO/Input Files/HybridStrategyParams.vb +++ b/VECTO/Input Files/HybridStrategyParams.vb @@ -104,6 +104,7 @@ Public Class HybridStrategyParams End Property Public Property ICEStartPenaltyFactor As Double Implements IHybridStrategyParameters.ICEStartPenaltyFactor + Public Property CostFactorSOCExpponent As Double Implements IHybridStrategyParameters.CostFactorSOCExpponent Public Property AuxiliaryBufferTime As Double diff --git a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs index 1a035e38dfc6be9a9715dad07a56c351d861ef10..8b1db1afafa4f30462b1cf0a35dbf469d84f894e 100644 --- a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs +++ b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs @@ -86,7 +86,9 @@ namespace TUGraz.VectoCommon.InputData Second AuxBufferTime { get; } Second AuxBufferChargeTime { get; } double ICEStartPenaltyFactor { get; } - } + + double CostFactorSOCExpponent { get; } + } public interface IVehicleEngineeringInputData : IVehicleDeclarationInputData { diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONHybridStrategyParameters.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONHybridStrategyParameters.cs index ea147286236ca457517a178bb264a56528a6b867..a6becdc4b968c17c33f7fa1ccb39e1d4de0db104 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONHybridStrategyParameters.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONHybridStrategyParameters.cs @@ -71,5 +71,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON return Body["ICEStartPenaltyFactor"] == null ? 0 : Body.GetEx<double>("ICEStartPenaltyFactor"); } } + + public double CostFactorSOCExpponent + { + get + { + return Body["CostFactorSOCExponent"] == null ? double.NaN : Body.GetEx<double>("CostFactorSOCExponent"); + } + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index e80654895728a06b975ca8d4e07d4a76affdfeb7..f0b3018b159e5cba89ca7d279429c95ca26ba90d 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -801,7 +801,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter AuxReserveTime = hybridStrategyParameters.AuxBufferTime, AuxReserveChargeTime = hybridStrategyParameters.AuxBufferChargeTime, MaxPropulsionTorque = torqueLimit, - ICEStartPenaltyFactor = hybridStrategyParameters.ICEStartPenaltyFactor + ICEStartPenaltyFactor = hybridStrategyParameters.ICEStartPenaltyFactor, + CostFactorSOCExponent = double.IsNaN(hybridStrategyParameters.CostFactorSOCExpponent) ? 5 : hybridStrategyParameters.CostFactorSOCExpponent, }; return retVal; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/HybridStrategyParameters.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/HybridStrategyParameters.cs index d2fa5c7cb8c3a7024bff00c57ac92052a11a62b8..411fe2d83ad47e481f6ac65eb20c4949335431b0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/HybridStrategyParameters.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/HybridStrategyParameters.cs @@ -24,5 +24,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data { public double ICEStartPenaltyFactor { get; set; } //public Watt MaxDrivetrainPower { get; set; } + + public double CostFactorSOCExponent { get; internal set; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs index d7880d853512d86d37192f4e9c3f7e0ac03ef4b8..1d11bdb6b2aa313e3cd4ee70e172aaa84f6352ee 100644 --- a/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs +++ b/VectoCore/VectoCore/OutputData/FileIO/JSONFileWriter.cs @@ -1132,7 +1132,8 @@ public class JSONFileWriter : IOutputFileWriter {"AuxBufferTime", hp.AuxBufferTime.Value()}, {"AuxBufferChgTime", hp.AuxBufferChargeTime.Value()}, {"MinICEOnTime", hp.MinimumICEOnTime.Value() }, - {"ICEStartPenaltyFactor", hp.ICEStartPenaltyFactor} + {"ICEStartPenaltyFactor", hp.ICEStartPenaltyFactor}, + {"CostFactorSOCExponent", hp.CostFactorSOCExpponent} }; WriteFile(header, body, filePath); }