0

Hello I have the following task but I am struggling to find a solution or ideas for it

We have a database with shop_results, shop_position and result class. The whole project is about a mini mall simulation that gets income for every shop after running it. We have settings, we look up the database for similar or the same settings in simulations, we get all results connected to these simulations, the application makes an assoc array position ->; revenue, based on the best revenue you sort the array, the sim gets the best performing shop, and gives him its best performing position, tries the same for each shop if it can’t give him its best position, it goes down the array to the next best position. As a result we get an array shop -> position, where the positions do not repeat. If there are no results in the database, the simulation runs as many times as positions we have (in a rollercoaster way) and does the above mentioned script to determine the best positioning of the shops.

  • If I've understood correctly, your simulator produces an Array of `Shop` , `Position` pairs, serialized in JSON. You wish to deserialize this to type `Dictionary`? Could you please A: Provide a JSON example, and B: Provide the class definitions of `Shop` and `Position`? – George Kerwood May 30 '20 at 12:23
  • The JSON file will output ResultID, ShopName, Income, PositionID from the database – Alexander Petrov May 30 '20 at 13:16
  • I meant you need to literally, copy and paste and example of JSON for people to see, and also show what properties `Shop` and `Position` once deserialized. Maybe just read this if you don't want to: https://stackoverflow.com/questions/1207731/how-can-i-deserialize-json-to-a-simple-dictionarystring-string-in-asp-net – George Kerwood May 30 '20 at 13:55
  • Does this answer your question? [How can I deserialize JSON to a simple Dictionary in ASP.NET?](https://stackoverflow.com/questions/1207731/how-can-i-deserialize-json-to-a-simple-dictionarystring-string-in-asp-net) – George Kerwood May 30 '20 at 13:56

0 Answers0