Skip to content

Commit

Permalink
fix: walkPerNode、walkLength param can be 1
Browse files Browse the repository at this point in the history
  • Loading branch information
diaohancai committed Oct 24, 2023
1 parent 5019b9d commit 6e9c660
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6e9c660

Please sign in to comment.