From 3eb591b4b004f5b76f82f6a9333ac9e20ba0b44e Mon Sep 17 00:00:00 2001 From: qishipengqsp Date: Thu, 22 Aug 2024 23:40:36 +0800 Subject: [PATCH] tmp --- .../java/ldbc/finbench/datagen/entities/nodes/Company.java | 3 ++- .../finbench/datagen/generation/events/PersonInvestEvent.java | 3 +-- .../datagen/generation/generators/ActivityGenerator.scala | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/ldbc/finbench/datagen/entities/nodes/Company.java b/src/main/java/ldbc/finbench/datagen/entities/nodes/Company.java index 4dcf2d2f..7cdb72b7 100644 --- a/src/main/java/ldbc/finbench/datagen/entities/nodes/Company.java +++ b/src/main/java/ldbc/finbench/datagen/entities/nodes/Company.java @@ -87,7 +87,7 @@ public List getCompanyInvestCompanies() { return companyInvestCompanies; } - public void scaleInvestmentRatios() { + public Company scaleInvestmentRatios() { double sum = 0; for (PersonInvestCompany pic : personInvestCompanies) { sum += pic.getRatio(); @@ -101,6 +101,7 @@ public void scaleInvestmentRatios() { for (CompanyInvestCompany cic : companyInvestCompanies) { cic.scaleRatio(sum); } + return this; } public boolean hasInvestedBy(Company company) { diff --git a/src/main/java/ldbc/finbench/datagen/generation/events/PersonInvestEvent.java b/src/main/java/ldbc/finbench/datagen/generation/events/PersonInvestEvent.java index f6da58fa..b876c0c0 100644 --- a/src/main/java/ldbc/finbench/datagen/generation/events/PersonInvestEvent.java +++ b/src/main/java/ldbc/finbench/datagen/generation/events/PersonInvestEvent.java @@ -1,10 +1,8 @@ package ldbc.finbench.datagen.generation.events; import java.io.Serializable; -import java.util.Collections; import java.util.List; import java.util.Random; -import ldbc.finbench.datagen.entities.edges.CompanyInvestCompany; import ldbc.finbench.datagen.entities.edges.PersonInvestCompany; import ldbc.finbench.datagen.entities.nodes.Company; import ldbc.finbench.datagen.entities.nodes.Person; @@ -44,6 +42,7 @@ public void personInvestPartition(List investors, List targets) } PersonInvestCompany.createPersonInvestCompany(randomFarm, investor, target); } + System.out.println("[personInvest]: person invest company " + numInvestors + " times"); } } diff --git a/src/main/scala/ldbc/finbench/datagen/generation/generators/ActivityGenerator.scala b/src/main/scala/ldbc/finbench/datagen/generation/generators/ActivityGenerator.scala index c04429cb..fc62e661 100644 --- a/src/main/scala/ldbc/finbench/datagen/generation/generators/ActivityGenerator.scala +++ b/src/main/scala/ldbc/finbench/datagen/generation/generators/ActivityGenerator.scala @@ -106,7 +106,6 @@ class ActivityGenerator()(implicit spark: SparkSession) ) targets.map { target => target.scaleInvestmentRatios() - target } } }