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

draft for factory production #144

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

draft for factory production #144

wants to merge 2 commits into from

Conversation

wvpm
Copy link
Contributor

@wvpm wvpm commented Jan 31, 2024

TODO:

  • hiring & firing
  • maintenance/upkeep goods
  • optimisations
  • state code
  • country code

void FactoryProducer::produce(
const fixed_point_t input_modifier, const fixed_point_t throughput_modifier, const fixed_point_t output_modifier
) {
std::map<PopType const* const, fixed_point_t> employees_per_job {};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be cached as a private field.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah this definitely should be cached, we'll also need it for tooltips

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think tooltips should be calculated on demand. It saves a memory and ensures the tooltips are up to date.

@@ -37,3 +44,64 @@ fixed_point_t FactoryProducer::get_average_profitability_last_seven_days() const

return sum / (1 + profit_history_current);
}

void FactoryProducer::produce(
const fixed_point_t input_modifier, const fixed_point_t throughput_modifier, const fixed_point_t output_modifier
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I imagine the country calls some method on each state, which calls this method for each factory.
The country & state create the modifier values here.

Copy link
Contributor

@Hop311 Hop311 left a comment

Choose a reason for hiding this comment

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

Great work with the equations, nice to see that we already have all these components available.

src/openvic-simulation/economy/FactoryProducer.cpp Outdated Show resolved Hide resolved
void FactoryProducer::produce(
const fixed_point_t input_modifier, const fixed_point_t throughput_modifier, const fixed_point_t output_modifier
) {
std::map<PopType const* const, fixed_point_t> employees_per_job {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah this definitely should be cached, we'll also need it for tooltips

src/openvic-simulation/economy/FactoryProducer.cpp Outdated Show resolved Hide resolved
src/openvic-simulation/pop/Pop.cpp Outdated Show resolved Hide resolved
@wvpm wvpm force-pushed the factory_turn branch 3 times, most recently from f275652 to 57b7a64 Compare January 31, 2024 22:02
@wvpm wvpm force-pushed the producer_types branch 2 times, most recently from b004547 to 1c0505e Compare February 5, 2024 08:29
@Hop311 Hop311 mentioned this pull request Feb 5, 2024
Base automatically changed from producer_types to master February 6, 2024 16:44
Hop311 added a commit to Hop311/OpenVic-Simulation that referenced this pull request Oct 13, 2024
First pass at pops (test pops and density mapmode)
@Spartan322 Spartan322 added the enhancement New feature or request label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants