Skip to content

Commit

Permalink
Add impulse length parameter to marginal emissions component
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Dec 21, 2012
1 parent 9667429 commit 44b1acf
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions FundComponents/MarginalEmissionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ namespace Fund.Components
public interface IMarginalEmissionState
{
Timestep emissionperiod { get; }

[DefaultParameterValue(10)]
int impulselength { get; }

IParameter1Dimensional<Timestep, Double> emission { get; }

IVariable1Dimensional<Timestep, Double> modemission { get; }
Expand All @@ -25,19 +29,12 @@ public void Run(Clock clock, IMarginalEmissionState state, IDimensions dimension
var t = clock.Current;
var s = state;

if (clock.IsFirstTimestep)
if ((t.Value >= s.emissionperiod.Value) && (t.Value < (s.emissionperiod.Value + s.impulselength)))
{

s.modemission[t] = s.emission[t] + 1;
}
else
{
if ((t.Value >= s.emissionperiod.Value) && (t.Value < (s.emissionperiod.Value + 10)))
{
s.modemission[t] = s.emission[t] + 1;
}
else
s.modemission[t] = s.emission[t];
}
s.modemission[t] = s.emission[t];
}

}
Expand Down

0 comments on commit 44b1acf

Please sign in to comment.