Skip to content
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

Update binary.py #34

Merged
merged 2 commits into from
Sep 25, 2017
Merged

Update binary.py #34

merged 2 commits into from
Sep 25, 2017

Conversation

CPapadim
Copy link
Contributor

Hi, I'm the reporter of issue 33

I think the issue is that rather than moving toward and returning the historical social / global best, you are moving toward and returning the current social / global best. I think for PSO you always need to be moving to historical and not current positions whether its the personal or the social / global best.

I've made some updates to fix the issue.

I tested on my code, and with my updates every iteration I either get the same 'best' position I had in the previous iteration, or a better one.

I'm not super familiar with this package's codebase so this request likely needs review and testing.

@CPapadim CPapadim mentioned this pull request Sep 25, 2017
@ljvmiranda921
Copy link
Owner

ljvmiranda921 commented Sep 25, 2017

Hey, thanks for the fix! I can accept this already, but would you like to compare your fix to mine? It would be nice to have more contributors as possible. 👍

Unfortunately, the local_best.py suffers a similar problem (see my PR). If you wish to fix the same, it is also welcome!

Thanks a lot for your effort!

@CPapadim
Copy link
Contributor Author

As we discussed, I think my fix keeps neighbors working properly. So that we're only using nearby particles for the social best rather than all of them. I can update local_best.py similarly

@ljvmiranda921
Copy link
Owner

Okay then, I'll just wait for the commit to be pushed :)

@ljvmiranda921
Copy link
Owner

ljvmiranda921 commented Sep 25, 2017

Nice, this is good to go 👍

Just one last logistical request. Normally I ask our contributors to rebase commits into 1 or 2. For this, probably one commit for the binary.py and another for local_best.py. And also, we follow this commit format:

Short and sweet imperative title (#33)

Short description that describes why the commit was done. The title
usually should be in present tense. Maybe "Fix error in <file> (#XX)"
then this paragraph will describe a little about what was fixed or the
general idea of the fix.

Author: <your-github-username>
Email: <your-contact-email>

That's all, after this we can merge already. Thanks a lot!

CPapadim and others added 2 commits September 24, 2017 22:43
The social / global best position was changed from the currently best found position to the historically best found position.

Author: CPapadim
email: papadimitriou.c@gmail.com
The social / global best position was changed from the currently best found position to the historically best found position.

Author: CPapadim
email: papadimitriou.c@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants