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

Add simple energy balance info without dictionaries #5780

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0HyperCube
Copy link
Contributor

Brief Description of What This PR Does

Create an EnergyBalanceInfoSimple class that doesn't record the consumption and production. This is used for the auto evo since it doesn't require the consumption and production information.

Also add an EnergyBalanceInfoFull class that inherits from EnergyBalanceInfoSimple but with the dictionaries for consumption and production. This is used for the editor display.

Since there are virtual methods now, this will likely be detrimental to performance. However I wasn't able to test the significance of this compared to removing the dictionary allocations for auto-evo since there doesn't see to be a great way to benchmark auto-evo.

Related Issues
Closes #5426

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

@revolutionary-bot
Copy link

The lead programmer for Thrive is currently on vacation until 2025-01-07. Until then other programmers will try to make pull request reviews, but please be patient if your PR is not getting reviewed.

PRs may be merged after multiple programmers have approved the changes (especially making sure to ensure style guide conformance and gameplay testing are good). If there are no active experienced programmers who can perform merges, PRs may need to wait until the lead programmer is back to be merged.

@dligr dligr requested review from a team December 30, 2024 13:35
@dligr dligr added the review label Dec 30, 2024
@dligr dligr added this to the Release 0.8.1 milestone Dec 30, 2024
Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already a very good start, but I kind of want the architecture split to go a bit deeper even if that means a bit of code duplication (but on balance removes the virtual methods).

src/auto-evo/simulation/SimulationCache.cs Show resolved Hide resolved
src/microbe_stage/systems/ProcessSystem.cs Outdated Show resolved Hide resolved
src/microbe_stage/systems/ProcessSystem.cs Outdated Show resolved Hide resolved
src/microbe_stage/EnergyBalanceInfoFull.cs Outdated Show resolved Hide resolved
src/microbe_stage/EnergyBalanceInfoSimple.cs Outdated Show resolved Hide resolved
@0HyperCube 0HyperCube closed this Jan 11, 2025
@hhyyrylainen
Copy link
Member

Is there a reason why this was closed?

@0HyperCube
Copy link
Contributor Author

@hhyyrylainen the changes requested around avoiding the virtual methods would involve rewriting the PR. I'm happy to do this when I have some free time.

@hhyyrylainen
Copy link
Member

Yeah, a bit of refactoring would be needed, but I thought it wouldn't require rewriting all of the PR so I was wondering about the close.

I'm happy to do this when I have some free time.

Totally fine. This isn't a super high priority thing so you can help out again once you have time.

@0HyperCube 0HyperCube reopened this Jan 29, 2025
@0HyperCube 0HyperCube force-pushed the add-simple-energy-balance branch from 5bc70bf to 7b6b2a6 Compare January 29, 2025 23:15
@0HyperCube
Copy link
Contributor Author

@hhyyrylainen I believe that I have refactored this PR as desired?

@hhyyrylainen
Copy link
Member

Overall it's a lot better now but some of the naming stuff doesn't fully make sense to me and the doc comments didn't make it clear why such a name was chosen.

@0HyperCube 0HyperCube marked this pull request as draft January 31, 2025 22:30
@0HyperCube 0HyperCube force-pushed the add-simple-energy-balance branch from 1cbd7b6 to e542006 Compare February 1, 2025 22:02
@0HyperCube 0HyperCube marked this pull request as ready for review February 1, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Create variant of GetEnergyBalanceForSpecies for auto-evo that just has the overall balance
5 participants