-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New connetivity vector operations for improved networks #3635
Conversation
This update introduces a new pre-clustering approach for finding optimal networks more efficiently. It effectively attempts to keep the networks more compact, which is assumed to be preferable to highly spread-out networks.
Alinging the naming of the newly introduced mutation and crossover methods to similar methods from the deap.tools library
The clustering based mutation and crossover operations were not fully implemented. This change offers an initial version of the operations.
The algorithm previously didn't reassign the cluster indexes of the individual buildings after clusters were subdivided. This change should fix that bug.
This new operation ensures that connectivity vectors that encode for the same connectivity state of a district are now forced to take on the same expression. This is done in an attempt to reduce the dimensionality of the problem, hopefully reducing the number of selected optimal solutions and speeding up convergence.
This introduces a second clustering method, which should take the network graph's layout into consideration more explicitly. The algorithm is based on the Louvain method for community detection.
Some duplicates could previously not be detected as some CapacityIndicatorVectors (CIV) held values of 0.0 and 1.0 (as floats) and others held 0 and 1 (as ints). With this change capacity indicator values of 0 and 1 will continuously be registered as integer values, allowing for proper comparisons and elimination of duplicates during the genetic optimisation.
Introducing methods to prevent network graphs from overlapping.
This introduces the chosen building clustering method as a parameter of the optimization script. The location where the latest network-modifying paramters are allocated is also slightly altered to align better with previous implementations for other class variables. This commit also fixes a typo "helpercalsses" to "helperclasses"
Changes detected in |
Changing how data type comparison is done to pass 'ruff' test
Changes detected in |
The envrionment.yml file used in this branch seems to have referred to an older version. This is a manual update of the changes that also includes the new operations required by the new clustering approaches.
The 'overlap_correction' method was briefly allocated to the 'Algorithm'-class but later added as a class variable of the connectivity vector class instead. This removes an artifact of the previous implementations.
Changes detected in |
1 similar comment
Changes detected in |
This PR works well. I tested it using a DH case in Zurich. |
By network-graph I mean the .geojson files output by the optimisation. They can be found in the individual "DCS_1XX/network" / "DHS_1XX/network" folders. The easiest way to visualise them currently is to upload the files to geojson.io. Among other things, I will be working better visualisation toolsfor the dashboard in the coming months, so the visualisation should be possible in CEA itself soon. |
@martin-mosteiro, I guess you're quite busy. Have you had any time to give this a try? If not, @ShiZhongming could we just merge the branch? |
@MatNif Sorry that I missed this - Let's merge it! |
The optimization algorithm manages to find converged solutions for thermal supply systems rather quickly, while the networks of the non-dominated solutions often look unrefined at best and completely counterintuitive at worst.
The changes introduced in this PR add a series of operations to the algorithm that can lead to better network structures faster. More explicitly, these new methods are:
Preclustering of the buildings either follows:
Or if one of these four operations should be chosen at random.
The parameters for these new operations have been added to the config. Default parameters have been set to ClusterSwitch, ClusterSwap, Louvain and Random based on a first series of tests.
To test this branch