@Override public boolean isValid() { final CircularDeformableCell thisNode = (CircularDeformableCell) getNode(); return env.getNodesWithinRange(thisNode, env.getMaxDiameterAmongCircularDeformableCells()).stream() .parallel() .flatMap(n -> n instanceof CellWithCircularArea ? Stream.of((CellWithCircularArea) n) : Stream.empty()) .filter(n -> { final double maxDN = thisNode.getMaxRadius(); if (n instanceof CircularDeformableCell) { return env.getDistanceBetweenNodes(n, thisNode) < (maxDN + ((CircularDeformableCell) n).getMaxRadius()); } else { return env.getDistanceBetweenNodes(n, thisNode) < (maxDN + n.getRadius()); } }) .findAny() .isPresent(); }
@Override public void execute() { final double[] nodePos = env.getPosition(getNode()).getCartesianCoordinates(); final List<Position> pushForces = env.getNodesWithinRange( thisNode, env.getMaxDiameterAmongCircularDeformableCells()).stream() .parallel() return env.getDistanceBetweenNodes(thisNode, n) < maxDist; } else { .map(n -> { final double[] nPos = env.getPosition(n).getCartesianCoordinates(); intensity = 1; } else { intensity = ((localNodeMaxRadius + nodeMaxRadius) - env.getDistanceBetweenNodes(n, thisNode)) / ((localNodeMaxRadius + nodeMaxRadius) - (localNodeMinRadius + nodeMinRadius));
@Override public double getPropensityConditioning() { final CircularDeformableCell thisNode = (CircularDeformableCell) getNode(); return env.getNodesWithinRange(thisNode, env.getMaxDiameterAmongCircularDeformableCells()).stream() minRn = maxRn; final double distance = env.getDistanceBetweenNodes(n, thisNode); if (((maxRn + maxRN) - distance) < 0) { return 0;