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
Publish breed agent set changes for use by the NW extension #400
Conversation
So... am I supposed to merge this right now, or is it waiting on more things to come? |
Waiting for more. |
https://github.com/scala/scala/blob/v2.9.2/src/library/scala/collection/mutable/Publisher.scala I'm not sure it's the most well-maintained part of the Scala stdlib, but it seems like fairly straightforward code to me. Also, I've already used them for the plotting and drawing layer event sourcing in master. If there was a problem with them (I don't think there is) we'd need to address it there as well.
Here are benchmarks from my laptop from before and after the change:
I am, however, skeptical of those results: two of the most impacted models, Heatbugs and Ants, have no agent births or deaths except in |
you've addressed my other concerns, so just waiting on the new performance numbers now. |
Here are new numbers, after running both branches over night:
Life is the only one that still seems negatively affected, but since it's a model that has no turtles/links births/deaths whatsoever, I would assume that we can chalk it up to a benchmarking artifact. If no one has further concerns, I am requesting merging. |
LGTM |
import scala.collection.mutable.Publisher | ||
|
||
sealed abstract trait SimpleChangeEvent | ||
case object SimpleChangeEvent extends SimpleChangeEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why mark the trait as abstract
? And why does the trait exist at all? If you want to parameterize Publisher
over the type of your case object, you can just say Publisher[SimpleChangeEvent.type]
.
I had two very similar similar SimpleChangeEvent subscriber classes for testing in TreeAgentSetTests and AbstractTestWorld. Now it's just one class used in both places.
@TheBizzle: Anyway, here's my answers:
An
Well, seems like I just learned a new thing about Scala! Thanks! 1ad6dc9 |
Publish breed agent set changes for use by the NW extension
This pull request addresses #399. It was originally just a commit on the 5.0.x branch (523b890) but I reverted it (0fe90a8) and turned it into a pull request in order to address the following questions by @SethTisue with further commits and comments (to come):