GoelBiju / Visualising-Optimisation-Data

COMP3000 Final Year Project - Visualising Optimisation Data
0 stars 0 forks source link

Replay optimisation run #37

Closed GoelBiju closed 3 years ago

GoelBiju commented 3 years ago

Description:

Provide the option for the user to replay the optimisation run for a running or complete run. For a running optimisation run, play the optimisation up until the current generation (or until the current data received). All the required data in order to replay the run should be fetched.

Acceptance criteria:

GoelBiju commented 3 years ago

There is a bug where pressing the live button when in replay mode causes the current generation to not go to the latest generation but stay on the generation it was on last when in replay mode.

This could be due to the fact we are requesting the run information on every request and as a result, the wrong information is used (?). A start would be to stop fetching the run information on every request if the run has already been completed.

GoelBiju commented 3 years ago

There is a bug where pressing the live button when in replay mode causes the current generation to not go to the latest generation but stay on the generation it was on last when in replay mode.

This could be due to the fact we are requesting the run information on every request and as a result, the wrong information is used (?). A start would be to stop fetching the run information on every request if the run has already been completed.

I have re-written the logic handling this so it goes but it even then it does not feel complete to me. One issue I realised was stale closures (example, React) which would mean that state variables cannot be accessed in the callback for socket when receiving data e.g. checking replay or controls.

GoelBiju commented 3 years ago

I am omitting the functionality to pause a replay as it is not required and would only add more conditions that could make the code and internal events more complicated.

GoelBiju commented 3 years ago

To avoid issues with multiple renders/API calls and React hooks interacting with each other and having too many state variables, I need to move code into separate components. For the time being, I will keep it like this but this is quite important.