In 918bcd8 I updated the /new_game route to send back the full game_config, which includes info about the storages. However the total capacities of the storages are not included. For example the power_storage only includes {'enrg_kwh': 1000} and there is no way to know if we have a 5000 kWh battery that is 20% full or a completely full 1000 kWh battery.
For the storages there are different capacities, for example the air_storage defines the capacity for each of the currencies/elements, and the total volume in the agent_desc.json file:
the volume gets converted into kg, which is the same unit used to track the amount of elements in the air_storage. This value however is not stored/used anywhere else, and it's what I need.
As an example, a 1 human preset sim, uses small crew quarters and no greenhouse. The volume of the small crew quarters is 1000 square meters, so the air storage (i.e. the air inside the crew quarters) is 1250 kg (which is what I need). This value contradicts the default air storage volume (3.568 m^3) and mass (4348.5 kg) and also the combined capacity of each of the elements in the air_storage (42000 kg).
For the water storage the values in kg and square meters coincide (i.e. a 1000 m^3 crew quarter will have a water storage of 1000 m^3 / 1000 kg), so there's nothing to do. For the power storage the volume is present in the agent_desc.json but ignored (and this is inconsistent, since the volume is sometimes used to indicate how much space is available inside the storage and other times the total space the storage takes), and the capacity of the enrg_kwh coincides with the total capacity. In addition the max capacity can also be passed by the client (I assume it overrides the value in the agent_desc.json).
So to summarize:
air_storage: I have the capacity for each currency/element (which I don't need and I'm not sure what's for), I have the total volume in square meters (of the air inside the storage), I calculate the mass in kg (of air inside the storage, which is what I need), and I also have the mass of the air storage itself (which I don't need);
water_storage: I have the capacity for each currency/type of water (which I don't need and I'm not sure what's for), I have the total volume in square meters (of the water inside the storage), the mass coincides with the volume (and it is what I need), and I also have the mass of the water storage itself (which I don't need);
power_storage: I have the capacity for enrg_kwh (which is the only currency in the battery), I have the total volume in square meters (which is unrelated to the storage), I have the capacity passed by the config wizard (which is what I need, assuming it overrides the one in the agent_desc.json), and I also have the mass of the battery itself (which I don't need);
nutrient_storage: I have the capacity for each currency (which I don't need and I'm not sure what's for, and it's also unrealistically high), I have the total volume in square meters (which is unrealistically low), I don't have any total capacity (and it is what I need), and I also have the mass of the nutrient storage itself (which I don't need);
food_storage: I have the capacity for food_edbl (which is the only currency in the storage, and what I need), I have the total volume in square meters (which is unrelated to the storage), and I also have the mass of the storage itself (which I don't need);
This raises a few questions:
do the volume/mass in the agent_desc.json refer to the storage itself or to the content of the storage?
if they refer to the storage itself, should we add an internal_capacity?
or should the internal capacity be calculated by adding together the max capacities of the currencies it contains?
if done this way, how can we passed a new total storage capacity from the configuration wizard?
does it make sense to have separate capacities for each element in the air storage, since they are all mixed?
should the separate capacities be expressed as a percentage of the total instead?
or should we have individual storages for currencies that should not be mixed and a "storage group" to group them together?
what would be a good way to handle all this in a generic way?
This is what I think we should do:
the simplest solution for now is to calculate and add the different totals that I need manually in the game config, using different values depending on the storage type;
we should clarify whether the volume/mass refers to the agent itself or its content;
we should clarify what the capacities for each currency in the storages in the agent_desc.json indicate;
we should update the values to make sure that all the different capacities match;
In 918bcd8 I updated the
/new_game
route to send back the fullgame_config
, which includes info about the storages. However the total capacities of the storages are not included. For example thepower_storage
only includes{'enrg_kwh': 1000}
and there is no way to know if we have a 5000 kWh battery that is 20% full or a completely full 1000 kWh battery.For the storages there are different capacities, for example the
air_storage
defines the capacity for each of the currencies/elements, and the total volume in theagent_desc.json
file:https://github.com/overthesun/simoc/blob/f136cc22296616a2477afc41f0232f8281bb2603/agent_desc.json#L6163-L6211
This piece of code seems to retrieve the capacity for each element: https://github.com/overthesun/simoc/blob/f136cc22296616a2477afc41f0232f8281bb2603/simoc_server/front_end_routes.py#L250-L251
But this other piece of code: https://github.com/overthesun/simoc/blob/f136cc22296616a2477afc41f0232f8281bb2603/simoc_server/front_end_routes.py#L149-L168 Uses the total volume of the greenhouse/habitat to calculate the capacity of the storage.
Since the volume is in square meters, in https://github.com/overthesun/simoc/blob/f136cc22296616a2477afc41f0232f8281bb2603/simoc_server/front_end_routes.py#L94-L114
the volume gets converted into kg, which is the same unit used to track the amount of elements in the air_storage. This value however is not stored/used anywhere else, and it's what I need.
As an example, a
1 human
preset sim, uses small crew quarters and no greenhouse. The volume of the small crew quarters is 1000 square meters, so the air storage (i.e. the air inside the crew quarters) is 1250 kg (which is what I need). This value contradicts the default air storage volume (3.568 m^3
) and mass (4348.5 kg
) and also the combined capacity of each of the elements in the air_storage (42000 kg
).For the water storage the values in kg and square meters coincide (i.e. a 1000 m^3 crew quarter will have a water storage of 1000 m^3 / 1000 kg), so there's nothing to do. For the power storage the volume is present in the
agent_desc.json
but ignored (and this is inconsistent, since thevolume
is sometimes used to indicate how much space is available inside the storage and other times the total space the storage takes), and the capacity of theenrg_kwh
coincides with the total capacity. In addition the max capacity can also be passed by the client (I assume it overrides the value in theagent_desc.json
).So to summarize:
enrg_kwh
(which is the only currency in the battery), I have the total volume in square meters (which is unrelated to the storage), I have the capacity passed by the config wizard (which is what I need, assuming it overrides the one in theagent_desc.json
), and I also have the mass of the battery itself (which I don't need);food_edbl
(which is the only currency in the storage, and what I need), I have the total volume in square meters (which is unrelated to the storage), and I also have the mass of the storage itself (which I don't need);This raises a few questions:
volume
/mass
in theagent_desc.json
refer to the storage itself or to the content of the storage?internal_capacity
?This is what I think we should do:
agent_desc.json
indicate;