MCPcopy Index your code
hub / github.com/DEAP/deap / sort

Method sort

doc/code/tutorials/part_4/sortingnetwork.py:65–70  ·  view source on GitHub ↗

Sort the values in-place based on the connectors in the network.

(self, values)

Source from the content-addressed store, hash-verified

63 last_level[wire1] = wire2
64
65 def sort(self, values):
66 """Sort the values in-place based on the connectors in the network."""
67 for level in self:
68 for wire1, wire2 in level.items():
69 if values[wire1] > values[wire2]:
70 values[wire1], values[wire2] = values[wire2], values[wire1]
71
72 def assess(self, cases=None):
73 """Try to sort the **cases** using the network, return the number of

Callers 8

assessMethod · 0.95
updateMethod · 0.45
updateMethod · 0.45
updateMethod · 0.45
assignCrowdingDistFunction · 0.45
sortLogNondominatedFunction · 0.45
selSPEA2Function · 0.45
sortByDimensionMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected