question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

interface Replacement

See original GitHub issue

Hi, I think it is necessary to add an input parameter, sizeOfTheResultingSolutionList , to the replace function below, so that the algorithm designer can operate more flexibly.

package org.uma.jmetal.component.replacement;

import org.uma.jmetal.solution.Solution;

import java.util.List;

@FunctionalInterface
public interface Replacement<S extends Solution<?>> {
  enum RemovalPolicy {sequential, oneShot}
  List<S> replace(List<S> currentList, List<S> offspringList) ;
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ajnebrocommented, Mar 16, 2020

I see the issue. The point is that I’m assuming the default case in which the size of the population in the next generation is the same as the size of the population passed as the first parameter to the replace() method.

Adding the parameter you need to the `RankingAndDensityEstimatorReplacement() is easy; just let me think about it. On the one hand, I dislike needing to add classes such as the one you mention but, on the other hand, I don’t want to make the existing class more complex than necessary.

1reaction
ajnebrocommented, Mar 16, 2020

Hi @dongzhiming. Thanks for your comment. That parameter is not included in the replace() method because it is not always needed (see for example the RankingAndDensityEstimatorReplacement() class) and anyway it can be a parameter of the constructor of the replacement class (as done in class MOEADReplacement()).

If you find a situation where this last approach does not work, please let me know.

Antonio

Read more comments on GitHub >

github_iconTop Results From Across the Web

VR Cover Facial Interface & Foam Replacement Set for ...
Facial Interface by VR Cover. Designed to fit perfectly on the Meta / Oculus Quest 2 headset, it can be easily installed to...
Read more >
Meta Quest 2 VR Cover Facial Interface & Foam Replacement ...
Shop the VR cover facial interface and foam replacement set for your Meta Quest 2 headset. Hygienic PU leather foam pads keep your...
Read more >
Valve Index Interface & Foam Replacement Basic Set
Designed to fully replace the original face gasket, each set gives you a magnetic facial interface, two memory foam replacements – Standard and...
Read more >
Radio Replacement - PAC Audio
Radio replacement interface with Built-in OnStar Retention, Steering Wheel Control Retention and Navigation Outputs ...
Read more >
Metra Car Audio Replacement Interface for Select Mazda ...
Shop Metra Car Audio Replacement Interface for Select Mazda Vehicles Red at Best Buy. Find low everyday prices and buy online for delivery...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found