Skip to content

Commit

Permalink
Merge pull request #30 from matsim-vsp/kmt_nkvPaper
Browse files Browse the repository at this point in the history
NKV Paper
  • Loading branch information
kt86 authored Jun 13, 2024
2 parents 7751d56 + 93274e0 commit 485d1b1
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 126 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/tub/vsp/bvwp/computation/Modifications.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
import org.apache.logging.log4j.Logger;

public record Modifications(double co2Price, double mehrFzkm, double constructionCostFactor, double nonCo2BenefitsFactor) {


//TODO nonCo2BenefitsFactor is not used in the codebase

private static final Logger log = LogManager.getLogger(Modifications.class);
public static final double INFLATION_Factor2020to2012 = 0.917; // Zinse Wert von 2020 auf BVWP Zeitpunkt 2012 ab.
public static final double co2PriceBVWP = 145.;
public static final double co2Price700 = 642.;
// (700 sind die Klimakosten von in 2030 erzeugten CO2-Emissionen, zum Preisstand 2020. Rückgerechnet nach 2012 führt das zu 642.)
public static final double co2Price2000 = 2000 * INFLATION_Factor2020to2012;
// (2000 als Annahme für die Klimakosten von in 2030 erzeugten CO2-Emissionen, zum Preisstand 2020. Rückgerechnet nach 2012)
/**
* Wie {@link #co2Price700}, aber mit 1% Zeitpräferenzrate.
*/
public static final double co2Price215 = 197.;


// public static final double co2Price680 = 623.;
// (haben wir früher mal verwendet)
// € 623 (in 2012) corresponds to € 680 in 2020 including the inflation.
Expand Down
19 changes: 17 additions & 2 deletions src/main/java/org/tub/vsp/bvwp/data/Headers.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,23 @@ public final class Headers{
* NKV bei erhöhtem CO2-Preis (welchem?).
*/
public static final String NKV_CO2 = "NKV_co2";
public static final String NKV_CO2_2000_EN = "BCR_co2_2000";
public static final String NKV_CO2_700_EN = "BCR_co2_700";
public static final String NKV_CO2_2000_EN = "BCR_co2_2000"; //2000 Euro/t -> muss dann noch nach 2012 umgerechnet werden
public static final String NKV_CO2_700_EN = "BCR_co2_700"; //700 Euro/t lt UBA für 2030 (Preisstand 2020) -> muss dann noch nach 2012 umgerechnet werden
/**
* NKV bei erhöhten Investitionskosten (welchen?).
*/
public static final String NKV_INVCOSTTUD_EN = "BCR_invcostTud"; // Projektspezifische erhöhte Investitionskosten (siehe TUD-Liste)
public static final String NKV_INVCOST150_EN = "BCR_invcost150"; //50% höhere Investmentcosts
public static final String NKV_INVCOST200_EN = "BCR_invcost200"; //doppelte Investmentcosts
/**
* NKV bei erhöhten Investitionskosten (welchen?) in Kombination mit erhöhtem CO2-Preis.
*/
public static final String NKV_CO2_2000_INVCOSTTUD_EN = "BCR_co2_2000_invcostTud"; // Projektspezifische erhöhte Investitionskosten (siehe TUD-Liste)
public static final String NKV_CO2_2000_INVCOST150_EN = "BCR_co2_2000_invcost150"; //50% höhere Investmentcosts
public static final String NKV_CO2_2000_INVCOST200_EN = "BCR_co2_2000_invcost200"; //doppelte Investmentcosts
public static final String NKV_CO2_700_INVCOSTTUD_EN = "BCR_co2_700_invcostTud"; // Projektspezifische erhöhte Investitionskosten (siehe TUD-Liste)
public static final String NKV_CO2_700_INVCOST150_EN = "BCR_co2_700_invcost150"; //50% höhere Investmentcosts
public static final String NKV_CO2_700_INVCOST200_EN = "BCR_co2_700_invcost200"; //doppelte Investmentcosts
/**
* {@link #NKV_EL03_CARBON215_INVCOSTTUD} - {@link #NKV_ORIG}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import java.util.SequencedMap;

import static org.tub.vsp.bvwp.computation.Modifications.NO_CHANGE;
import static org.tub.vsp.bvwp.computation.Modifications.co2Price2000;
import static org.tub.vsp.bvwp.computation.Modifications.co2Price700;
import static org.tub.vsp.bvwp.data.container.analysis.StreetAnalysisDataContainer.INFLATION_Factor2020to2012;


public class RailAnalysisDataContainer {
Expand Down Expand Up @@ -61,7 +61,7 @@ private void addComputations() {
entries.put(Headers.NKV_CO2, NkvCalculatorRail.calculateNkv(new Modifications(co2Price700, 0., 1, 1.), baseDataContainer));
entries.put(Headers.NKV_CO2_700_EN, NkvCalculatorRail.calculateNkv(new Modifications(co2Price700, 0., 1, 1.), baseDataContainer));
entries.put(Headers.NKV_CARBON700, NkvCalculatorRail.calculateNkv(new Modifications(co2Price700, 0., 1, 1.), baseDataContainer));
entries.put(Headers.NKV_CO2_2000_EN, NkvCalculatorRail.calculateNkv( new Modifications( 2000 * INFLATION_Factor2020to2012, 0, 1, 1 ), baseDataContainer ) );
entries.put(Headers.NKV_CO2_2000_EN, NkvCalculatorRail.calculateNkv( new Modifications( co2Price2000, 0, 1, 1 ), baseDataContainer ) );
// entries.put(Headers.NKV_EL03, NkvCalculatorRail.calculateNkv( new Modifications( co2PriceBVWP, addtlFzkmBeyondPrinsEl03, 1, 1. ), baseDataContainer ) );
// entries.put(Headers.NKV_EL03_CARBON215_INVCOSTTUD, NkvCalculatorRail.calculateNkv( new Modifications( co2Price215, addtlFzkmBeyondPrinsEl03, constructionCostFactor, 1. ), baseDataContainer ) );
// entries.put(Headers.NKV_EL03_CARBON700tpr0_INVCOSTTUD, NkvCalculatorRail.calculateNkv( new Modifications( co2Price700, addtlFzkmBeyondPrinsEl03, constructionCostFactor, 1.75 ), baseDataContainer ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class StreetAnalysisDataContainer {
private final SequencedMap<String, Double> entries = new LinkedHashMap<>();
private final List<String> remarks = new ArrayList<>();
private final double constructionCostTud;
static final double INFLATION_Factor2020to2012 = 0.917; // Zinse Wert von 2020 auf BVWP Zeitpunkt 2012 ab.

public StreetAnalysisDataContainer(StreetBaseDataContainer streetBaseDataContainer, double investmentCostNew ) {
this.streetBaseData = streetBaseDataContainer;
Expand Down Expand Up @@ -79,15 +78,30 @@ private void addComputations() {

entries.put(Headers.NKV_ORIG, NkvCalculator.calculateNkv( NO_CHANGE, streetBaseData ) );
entries.put(Headers.NKV_CO2, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0., 1, 1.75 ), streetBaseData ) );
entries.put(Headers.NKV_CO2_700_EN, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0., 1, 1.75 ), streetBaseData ) );
entries.put(Headers.NKV_CARBON700, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0., 1, 1.75 ), streetBaseData ) );
entries.put(Headers.NKV_CO2_2000_EN, NkvCalculator.calculateNkv( new Modifications( 2000 * INFLATION_Factor2020to2012, 0, 1, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_700_EN, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0., 1, 1. ), streetBaseData ) );
// entries.put(Headers.NKV_CARBON700, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0., 1, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_2000_EN, NkvCalculator.calculateNkv( new Modifications(
co2Price2000, 0, 1, 1. ), streetBaseData ) );
entries.put(Headers.NKV_EL03, NkvCalculator.calculateNkv( new Modifications( co2PriceBVWP, addtlFzkmBeyondPrinsEl03, 1, 1. ), streetBaseData ) );
entries.put(Headers.NKV_EL03_CARBON215_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications( co2Price215, addtlFzkmBeyondPrinsEl03, constructionCostFactor, 1. ), streetBaseData ) );
entries.put(Headers.NKV_EL03_CARBON700tpr0_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications( co2Price700, addtlFzkmBeyondPrinsEl03, constructionCostFactor, 1.75 ), streetBaseData ) );
entries.put(Headers.NKV_EL03_CARBON700tpr0, NkvCalculator.calculateNkv( new Modifications( co2Price700, addtlFzkmBeyondPrinsEl03, 1., 1.75 ), streetBaseData ) );
// entries.put(Headers.NKV_EL03_CO2_INVCOST50, NkvCalculator.calculateNkv( new Modifications( co2Price700, addtlFzkmBeyondPrinsEl03, constructionCostFactor ), streetBaseData ) );

//Für EWGT Paper KMT
//Nur Investitionskosten ändern sich
entries.put(Headers.NKV_INVCOSTTUD_EN, NkvCalculator.calculateNkv( new Modifications( co2PriceBVWP, 0, constructionCostFactor, 1. ), streetBaseData ) );
entries.put(Headers.NKV_INVCOST150_EN, NkvCalculator.calculateNkv( new Modifications( co2PriceBVWP, 0, 1.5, 1. ), streetBaseData ) );
entries.put(Headers.NKV_INVCOST200_EN, NkvCalculator.calculateNkv( new Modifications( co2PriceBVWP, 0, 2, 1. ), streetBaseData ) );

//Investitionskosten und CO2 Preis ändern sich
entries.put(Headers.NKV_CO2_700_INVCOSTTUD_EN, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0, constructionCostFactor, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_700_INVCOST150_EN, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0, 1.5, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_700_INVCOST200_EN, NkvCalculator.calculateNkv( new Modifications( co2Price700, 0, 2, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_2000_INVCOSTTUD_EN, NkvCalculator.calculateNkv( new Modifications( co2Price2000, 0, constructionCostFactor, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_2000_INVCOST150_EN, NkvCalculator.calculateNkv( new Modifications( co2Price2000, 0, 1.5, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_2000_INVCOST200_EN, NkvCalculator.calculateNkv( new Modifications( co2Price2000, 0, 2, 1. ), streetBaseData ) );

entries.put(Headers.ADDTL_PKWKM_EL03, addtlFzkmFromElasticity03 );
entries.put(Headers.CO2_COST_ORIG, Math.max( 1., NkvCalculator.calculateCost_CO2( NO_CHANGE, streetBaseData ) ) );
entries.put(Headers.CO2_COST_EL03, Math.max( 1., NkvCalculator.calculateCost_CO2( new Modifications( co2PriceBVWP, addtlFzkmBeyondPrinsEl03, 1, 1. ), streetBaseData ) ) );
Expand All @@ -101,7 +115,8 @@ private void addComputations() {
entries.put( Headers.NKV_ELTTIME_CARBON215_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications( co2Price215, addtlFzkmFromTtime, constructionCostFactor, 1. ), streetBaseData ) );
entries.put( Headers.NKV_ELTTIME_CARBON700TPR0_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications( co2Price700, addtlFzkmFromTtime, constructionCostFactor, 1.75 ), streetBaseData ) );

entries.put( Headers.NKV_ELTTIME_CARBON2000_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications( 2000 * INFLATION_Factor2020to2012, addtlFzkmFromTtime, constructionCostFactor, 1.75 ), streetBaseData ) );
entries.put( Headers.NKV_ELTTIME_CARBON2000_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications(
co2Price2000, addtlFzkmFromTtime, constructionCostFactor, 1.75 ), streetBaseData ) );

if ( streetBaseData.getProjectInformation().getProjectNumber().contains("A1-G50-NI" )) {
this.remarks.add("Eher geringer Benefit pro km ... erzeugt dann ueber die El pro km relativ viel Verkehr " +
Expand Down
20 changes: 18 additions & 2 deletions src/main/java/org/tub/vsp/bvwp/users/kmt/FiguresKMT.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ static Figure createFigureCO2(Axis xAxis, int plotWidth, Table table, String xNa
.width( plotWidth )
.build();


Trace trace = ScatterTrace.builder( table.numberColumn( xName ), table.numberColumn( yName ) )
.name( yName )
.text( table.stringColumn( Headers.PROJECT_NAME ).asObjectArray() )
Expand Down Expand Up @@ -214,7 +213,7 @@ static Figure createFigureNkvChange(int plotWidth, Table table, String xName, St
.title( yName )
.build();

Layout layout = Layout.builder( xName )
Layout layout = Layout.builder( yName + " over " +xName )
.xAxis( xAxis )
.yAxis( yAxis )
.width( plotWidth )
Expand Down Expand Up @@ -252,4 +251,21 @@ static Figure createFigureNkvChange(int plotWidth, Table table, String xName, St

return new Figure( layout, cbrOverCbrTrace, diagonale, horizontalCbr1, verticalCbr1 );
}


/** Idee um eine Trennung zu erzeugen... Noch nicht optimal
* @param title
* @return
*/
static Figure createTextFigure(String title){

Layout layout = Layout.builder( title )
.yAxis(Axis.builder().visible(false).build())
.xAxis(Axis.builder().visible(false).build())
.width( 1)
.height(1)
.build();

return new Figure(layout);
}
}
Loading

0 comments on commit 485d1b1

Please sign in to comment.