onclave / NSGA-II

an implementation of NSGA-II in java
MIT License
43 stars 22 forks source link

introduce a new problem to solve with nsgaII algorithm #2

Closed nabil215 closed 4 years ago

nabil215 commented 4 years ago

hello everyone i would like to know how to adapt a new problem with this code like the new objective functions the new operators new variables

onclave commented 4 years ago

@nabil215 To adapt this to new objective functions, you simply have to write your objective function by extending the IObjectiveFunction interface and implement its objectiveFunctionTitle() and getObjectiveValue() functions. All you have to do then is add a new object of your objective function in the Configuration's buildObjectives() method.

As an example, you can see two objective functions, SCH_1 and SCH_2 written which implements the IObjectiveFunction interface and which is then added in Configuration's buildObjectives() as

newObjectives.add(0, new SCH_1());
newObjectives.add(1, new SCH_2());

Hope this helps. But I am unsure what you mean by "new operators new variables". Do elaborate.

nabil215 commented 4 years ago

Thanks i will try But since i have problems with dependencies i can't run It show me on netbeans that some dependency artifacts are not in the local repository Any ideas how to solve this problem

Le ven. 24 avr. 2020 à 7:18 AM, Debabrata Acharya notifications@github.com a écrit :

@nabil215 https://github.com/nabil215 To adapt this to new objective functions, you simply have to write your objective function by extending the IObjectiveFunction interface https://github.com/onclave/NSGA-II/blob/master/src/main/java/io/onclave/nsga/ii/interfaces/IObjectiveFunction.java and implement its objectiveFunctionTitle() and getObjectiveValue() functions. All you have to do then is add a new object of your objective function in the Configuration https://github.com/onclave/NSGA-II/blob/master/src/main/java/io/onclave/nsga/ii/api/Configuration.java's buildObjectives() method.

As an example, you can see two objective functions, SCH_1 https://github.com/onclave/NSGA-II/blob/master/src/main/java/io/onclave/nsga/ii/objectivefunction/SCH_1.java and SCH_2 https://github.com/onclave/NSGA-II/blob/master/src/main/java/io/onclave/nsga/ii/objectivefunction/SCH_2.java written which implements the IObjectiveFunction interface and which is then added in Configuration's buildObjectives() as

newObjectives.add(0, new SCH_1()); newObjectives.add(1, new SCH_2());

Hope this helps. But I am unsure what you mean by "new operators new variables". Do elaborate.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/onclave/NSGA-II/issues/2#issuecomment-618825144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF44AMIBHAH4RX5SEPZ5ELDROEVJXANCNFSM4MPFHFFQ .

onclave commented 4 years ago

@nabil215 can you post the complete error that netbeans is throwing you?

Side note: since this is a maven project, make sure all your dependencies are downloaded before you can build the project by running the POM file. Netbeans should do that for you automatically on your first run or you can right click on dependencies and select “download dependency”.

This project has jfreecharts dependency.

onclave commented 4 years ago

Closing this issue due to inactivity. Reopen if necessary.