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

Tensor variables are causing conflicts with current database code #147

Open
juropo opened this issue Aug 27, 2024 · 1 comment
Open

Tensor variables are causing conflicts with current database code #147

juropo opened this issue Aug 27, 2024 · 1 comment

Comments

@juropo
Copy link

juropo commented Aug 27, 2024

At least the SolutionArchive class in desdeo/api/db_models.py is expecting decision variable values to be stored as an array of floats. With the introduction of tensor variables an array of floats feels even less of an ideal format for storing these values than it did before.

Of course it is possible to just force any kind of combination on n-dimensional arrays into a single array of numbers, but that makes reading those numbers later quite difficult.

I would like to store the decision variable values as json instead. That way we could effectively use dicts to store them, and the multidimensionality would no longer cause problems. Even the values stored to the database would be somewhat human readable.

To get the NIMBUS method working in the api and ui, I have a version of the code that just flattens all the arrays into a single array, like I said above, this does not feel like an ideal solution.

@maihoangbichtram
Copy link

maihoangbichtram commented Aug 28, 2024

I changed the column type to custom type as json as in Gnimbus It can save both variables and tensor variables.

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

No branches or pull requests

2 participants