diff options
Diffstat (limited to 'src/actions/simulation')
| -rw-r--r-- | src/actions/simulation/load-metric.js | 8 | ||||
| -rw-r--r-- | src/actions/simulation/playback.js | 15 | ||||
| -rw-r--r-- | src/actions/simulation/tick.js | 49 |
3 files changed, 0 insertions, 72 deletions
diff --git a/src/actions/simulation/load-metric.js b/src/actions/simulation/load-metric.js deleted file mode 100644 index c59e3596..00000000 --- a/src/actions/simulation/load-metric.js +++ /dev/null @@ -1,8 +0,0 @@ -export const CHANGE_LOAD_METRIC = "CHANGE_LOAD_METRIC"; - -export function changeLoadMetric(metric) { - return { - type: CHANGE_LOAD_METRIC, - metric - }; -} diff --git a/src/actions/simulation/playback.js b/src/actions/simulation/playback.js deleted file mode 100644 index 8e913914..00000000 --- a/src/actions/simulation/playback.js +++ /dev/null @@ -1,15 +0,0 @@ -export const SET_PLAYING = "SET_PLAYING"; - -export function playSimulation() { - return { - type: SET_PLAYING, - playing: true - }; -} - -export function pauseSimulation() { - return { - type: SET_PLAYING, - playing: false - }; -} diff --git a/src/actions/simulation/tick.js b/src/actions/simulation/tick.js deleted file mode 100644 index a629b340..00000000 --- a/src/actions/simulation/tick.js +++ /dev/null @@ -1,49 +0,0 @@ -import { getDatacenterIdOfTick } from "../../util/timeline"; -import { setCurrentDatacenter } from "../topology/building"; - -export const GO_TO_TICK = "GO_TO_TICK"; -export const SET_LAST_SIMULATED_TICK = "SET_LAST_SIMULATED_TICK"; - -export function incrementTick() { - return (dispatch, getState) => { - const { currentTick } = getState(); - dispatch(goToTick(currentTick + 1)); - }; -} - -export function goToTick(tick) { - return (dispatch, getState) => { - const state = getState(); - - let sections = []; - if (state.currentExperimentId !== -1) { - const sectionIds = - state.objects.path[ - state.objects.experiment[state.currentExperimentId].pathId - ].sectionIds; - - if (sectionIds) { - sections = sectionIds.map( - sectionId => state.objects.section[sectionId] - ); - } - } - - const newDatacenterId = getDatacenterIdOfTick(tick, sections); - if (state.currentDatacenterId !== newDatacenterId) { - dispatch(setCurrentDatacenter(newDatacenterId)); - } - - dispatch({ - type: GO_TO_TICK, - tick - }); - }; -} - -export function setLastSimulatedTick(tick) { - return { - type: SET_LAST_SIMULATED_TICK, - tick - }; -} |
