Skip to content

Commit

Permalink
Merge pull request #28 from matsim-vsp/kmt_nkvPaper
Browse files Browse the repository at this point in the history
minor renamings
  • Loading branch information
kt86 authored Jun 7, 2024
2 parents 165b749 + 2f93f4f commit 205bd3f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public record Modifications(double co2Price, double mehrFzkm, double constructio
public static final Modifications NO_CHANGE = new Modifications(co2PriceBVWP, 0., 1, 1. );

@Override public String toString() {
return "[co2Price=" + co2Price + "; mehrFzkm=" + mehrFzkm + "]";
return "[co2Price=" + co2Price + "; mehrFzkm=" + mehrFzkm + "; constructionCostFactor" + constructionCostFactor + "; constructionCostFactor" + nonCo2BenefitsFactor + " ]";
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/tub/vsp/bvwp/data/Headers.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public final class Headers{
*/
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_680";
public static final String NKV_CO2_700_EN = "BCR_co2_700";
/**
* {@link #NKV_EL03_CARBON215_INVCOSTTUD} - {@link #NKV_ORIG}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import static org.tub.vsp.bvwp.computation.Modifications.NO_CHANGE;
import static org.tub.vsp.bvwp.computation.Modifications.co2Price700;
import static org.tub.vsp.bvwp.data.container.analysis.StreetAnalysisDataContainer.INFLATION_Factor2022to2012;
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_Factor2022to2012, 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_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,7 @@ 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_Factor2022to2012 = 0.917; // Zinse Wert von 2020 auf BVWP Zeitpunkt 2012 ab.
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 @@ -81,7 +81,7 @@ private void addComputations() {
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_Factor2022to2012, 0, 1, 1. ), streetBaseData ) );
entries.put(Headers.NKV_CO2_2000_EN, NkvCalculator.calculateNkv( new Modifications( 2000 * INFLATION_Factor2020to2012, 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 ) );
Expand All @@ -101,7 +101,7 @@ 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_Factor2022to2012, addtlFzkmFromTtime, constructionCostFactor, 1.75 ), streetBaseData ) );
entries.put( Headers.NKV_ELTTIME_CARBON2000_INVCOSTTUD, NkvCalculator.calculateNkv( new Modifications( 2000 * INFLATION_Factor2020to2012, 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.tub.vsp.bvwp.users.kmt;

import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.tub.vsp.bvwp.BvwpUtils;
Expand Down Expand Up @@ -31,8 +32,8 @@
public class RunLocalCsvScrapingKMT {
private static final Logger logger = LogManager.getLogger(RunLocalCsvScrapingKMT.class );

public static void main(String[] args) throws IOException {
Locale.setDefault(Locale.US);
public static void main(String[] args) throws IOException{
Locale.setDefault( Locale.US );

logger.warn(
"(vermutl. weitgehend gelöst) Teilweise werden die Hauptprojekte bewertet und nicht" +
Expand All @@ -52,14 +53,22 @@ public static void main(String[] args) throws IOException {

StreetScraper scraper = new StreetScraper();

logger.info("Starting scraping");
logger.info( "Starting scraping" );

String filePath = "../shared-svn/";
Map<String, Double> constructionCostsByProject = BvwpUtils.getConstructionCostsFromTudFile(filePath );

final String regexToExclude = "(A...B.*)|(A....B.*)"; // Bundesstrassen, die von Autobahnen ausgehen.

// yyyy man könnte (sollte?) den table in den StreetAnalysisDataContainer mit hinein geben, und die Werte gleich dort eintragen. kai, feb'24

List<StreetAnalysisDataContainer> allStreetBaseData = scraper
.extractAllLocalBaseData("./data/street/all2", "A", ".*", "")
.stream()
.map(streetBaseDataContainer -> new StreetAnalysisDataContainer(streetBaseDataContainer, 0.) )
.map(streetBaseDataContainer -> new StreetAnalysisDataContainer(streetBaseDataContainer,
0.
// constructionCostsByProject.get(streetBaseDataContainer.getProjectInformation().getProjectNumber())
))
.toList();

logger.info("Writing csv");
Expand Down

0 comments on commit 205bd3f

Please sign in to comment.