From 6e9c66018b004849fce3f93368ab39efe4444ccf Mon Sep 17 00:00:00 2001 From: diaohancai Date: Tue, 24 Oct 2023 10:35:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20walkPerNode=E3=80=81walkLength=20param?= =?UTF-8?q?=20can=20be=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hugegraph/computer/algorithm/sampling/RandomWalk.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java b/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java index 580163375..4bc6cb6da 100644 --- a/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java +++ b/computer-algorithm/src/main/java/org/apache/hugegraph/computer/algorithm/sampling/RandomWalk.java @@ -68,16 +68,16 @@ public String name() { @Override public void init(Config config) { this.walkPerNode = config.getInt(OPTION_WALK_PER_NODE, 3); - if (this.walkPerNode < 1) { - throw new ComputerException("The param %s must be greater than 1, " + + if (this.walkPerNode <= 0) { + throw new ComputerException("The param %s must be greater than 0, " + "actual got '%s'", OPTION_WALK_PER_NODE, this.walkPerNode); } LOG.info("[RandomWalk] algorithm param, {}: {}", OPTION_WALK_PER_NODE, walkPerNode); this.walkLength = config.getInt(OPTION_WALK_LENGTH, 3); - if (this.walkLength < 1) { - throw new ComputerException("The param %s must be greater than 1, " + + if (this.walkLength <= 0) { + throw new ComputerException("The param %s must be greater than 0, " + "actual got '%s'", OPTION_WALK_LENGTH, this.walkLength); }