Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Note all install methods after "main" take
<h5py/>
<numpy>1.26</numpy>
<scipy>1.12</scipy>
<scipy source="pip">1.12</scipy>
<scikit-learn>1.1</scikit-learn>
<pandas/>
<!-- Note most versions of xarray work, but some (such as 0.20) don't -->
Expand Down
12 changes: 5 additions & 7 deletions ravenframework/utils/frontUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def crowdingDistance(rank, popSize, fitness):
if numPoints <= 2: # If front has 2 or fewer points, set to infinity
crowdDist[frontIndices[f]] = np.inf
continue
boundaries = []
for obj in range(numObjectives):
# Sort points in current front by current objective
sortedFront = [i for i in front]
Expand All @@ -141,16 +142,13 @@ def crowdingDistance(rank, popSize, fitness):
# Set boundary points to infinity
crowdDist[sortedFront[0]] = np.inf
crowdDist[sortedFront[-1]] = np.inf

# Ensure all repeated boundary points are set to infinity
boundaryValueMin = fitness[sortedFront[0], obj]
boundaryValueMax = fitness[sortedFront[-1], obj]
boundaries.append(fitness[sortedFront[0], :])
boundaries.append(fitness[sortedFront[-1], :])

for i in range(1, numPoints - 1):
if fitness[sortedFront[i], obj] == boundaryValueMin:
crowdDist[sortedFront[i]] = np.inf
if fitness[sortedFront[i], obj] == boundaryValueMax:
crowdDist[sortedFront[i]] = np.inf
if any(np.array_equal(fitness[sortedFront[i],:], arr) for arr in boundaries):
crowdDist[sortedFront[i]] = np.inf

# Skip normalization if all values are identical
fMax = fitness[sortedFront, obj].max()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.