simulator Package

monitors_wizard_handler

class tvb.interfaces.web.controllers.simulator.monitors_wizard_handler.MonitorsWizardHandler[source]

Bases: object

static get_current_and_next_monitor_form(current_monitor_vm_name, simulator)[source]
static get_fragment_after_monitors(simulator, burst_config, project_id, is_branch, rendering_rules, setup_pse_url)[source]
handle_next_fragment_for_monitors(context, rendering_rules, current_monitor, next_monitor, is_noise_form, form_action_url, if_bold_url)[source]
static prepare_monitor_fragment(simulator, rendering_rules, form_action_url)[source]
static prepare_monitor_legend(is_surface_simulation, monitor)[source]
prepare_next_fragment_after_noise(simulator, is_branch, rendering_rules, monitors_url, noise_equation_params_url)[source]
set_monitors_list_on_simulator(session_stored_simulator, monitor_names)[source]
static update_monitor(monitor_vm_instance, simulator)[source]

simulator_controller

class tvb.interfaces.web.controllers.simulator.simulator_controller.SimulatorController[source]

Bases: BurstBaseController

BRANCH_NAME_FORMAT = '{}_branch{}'
COPY_NAME_FORMAT = 'copy_of_{}'
KEY_IS_LOAD_AFTER_REDIRECT = 'is_load_after_redirect'
KEY_KEEP_SAME_SIM_WIZARD = 'keep_same_wizard'
branch_simulator_configuration(burst_config_id)[source]
static build_monitor_url(fragment_url, monitor)[source]
cancel_or_remove_burst(burst_id)[source]

Cancel or Remove the burst entity given by burst_id (and all linked entities: op, DTs) :returns True: if the op was successfully.

cancel_or_remove_operation(operation_id, is_group, remove_after_stop=False)[source]

Stop the operation given by operation_id. If is_group is true stop all the operations from that group.

copy_simulator_configuration(burst_config_id)[source]
export(burst_id)[source]
get_first_monitor_fragment_url(simulator, monitors_url)[source]
get_history_status(**data)[source]

For each burst id received, get the status and return it.

get_last_fragment_url(burst_config_id)[source]
get_upload_overlay()[source]
get_url_after_monitor_equation(next_monitor)[source]
get_url_after_monitors(current_monitor, monitor_name, next_monitor)[source]
static get_url_for_final_fragment(burst_config)[source]
get_urls_for_next_monitor_fragment(next_monitor, current_monitor)[source]
index()[source]

Get on burst main page

launch_pse(**data)[source]
launch_simulation(launch_mode, **data)[source]
load_burst_history(initBurst=None)[source]

Load the available burst that are stored in the database at this time. This is one alternative to ‘chrome-back problem’.

load_burst_read_only(burst_config_id)[source]
load_simulator_configuration_from_zip(**data)[source]

Upload Simulator from previously exported ZIP file

prepare_first_fragment()[source]
rename_burst(burst_id, burst_name)[source]

Rename the burst given by burst_id, setting it’s new name to burst_name.

reset_simulator_configuration()[source]
set_connectivity(**data)[source]
set_cortex(**data)[source]
set_coupling_params(**data)[source]
set_fragment_url(**data)[source]
set_integrator(**data)[source]
set_integrator_params(**data)[source]
set_model(**data)[source]
set_model_params(**data)[source]
set_monitor_equation(current_monitor_name, **data)[source]
set_monitor_params(current_monitor_name, **data)[source]
set_monitors(**data)[source]
set_noise_equation_params(**data)[source]
set_noise_params(**data)[source]
set_pse_params(**data)[source]
set_stimulus(**data)[source]
set_surface(**data)[source]
setup_pse(**data)[source]

simulator_fragment_rendering_rules

class tvb.interfaces.web.controllers.simulator.simulator_fragment_rendering_rules.SimulatorFragmentRenderingRules(form=None, form_action_url=None, previous_form_action_url=None, is_simulation_copy=False, is_simulation_readonly_load=False, last_form_url='/burst/set_connectivity', last_request_type='GET', is_first_fragment=False, is_launch_fragment=False, is_model_fragment=False, is_surface_simulation=False, is_noise_fragment=False, is_launch_pse_fragment=False, is_pse_launch=False, monitor_name=None, is_branch=False)[source]

Bases: object

This class gathers the rendering rules for simulator_fragment template. TVB > 2.0 brings a change of UI inside the simulator configuration page. Instead of a pre-loaded huge form with all the configurations, we want to have a wizzard-like page. Thus, the configurations are grouped into fragments and each fragment is rendered as a separate form. Each form provides the user with Next/Previous buttons, and some of them bring some extras:

  • model form provides the buttons: setup region model parameters/setup surface model parameters;

  • last fragment provides extra Launch/Setup PSE buttons, and a Branch button when it’s the case.

There are several cases that should be taken into consideration for the UX:
  • for a normal configuration, the user would just select the proper configurations and click Next to go to the

next form. When the Next button is clicked, the current form is made read-only. If the user need to make changes to a previous form that is already read-only, he might use the Previous buttons to get there, make the change, and come back clicking Next again. - from the history list, the user could choose to inspect an existing simulator configuration, by clicking on it. This will load the full configuration as read-only forms, without any buttons. - from the history list, the user also has the option to copy an existing simulator configuration A and edit it, or start a new simulation B using the results from A as initial conditions. This results, in a semi-read-only load of simulator configuration A, because the user will have the options:

  • to use the Previous buttons in order to edit configuration A and the Launch/Setup PSE buttons to start a

new simulation. - to use the Branch button in order to start a new simulation B that will use results from A as initial conditions.

So, we need a series of rendering rules, to know when to display/hide each button, and also make fields read-only.

FIRST_FORM_URL = '/burst/set_connectivity'
property disable_fields
property hide_launch_and_setup_pse_button
property hide_previous_button
property include_branch_button
property include_launch_button
property include_launch_pse_button
property include_next_button
property include_previous_button
property include_setup_noise
property include_setup_pse
property include_setup_region_model
property include_setup_surface_model
property load_readonly
to_dict()[source]

simulator_wizzard_urls

class tvb.interfaces.web.controllers.simulator.simulator_wizzard_urls.SimulatorWizzardURLs[source]

Bases: object

LAUNCH_PSE_URL = '/burst/launch_pse'
SETUP_PSE_URL = '/burst/setup_pse'
SET_CONNECTIVITY_URL = '/burst/set_connectivity'
SET_CORTEX_URL = '/burst/set_cortex'
SET_COUPLING_PARAMS_URL = '/burst/set_coupling_params'
SET_INTEGRATOR_PARAMS_URL = '/burst/set_integrator_params'
SET_INTEGRATOR_URL = '/burst/set_integrator'
SET_MODEL_PARAMS_URL = '/burst/set_model_params'
SET_MODEL_URL = '/burst/set_model'
SET_MONITORS_URL = '/burst/set_monitors'
SET_MONITOR_EQUATION_URL = '/burst/set_monitor_equation'
SET_MONITOR_PARAMS_URL = '/burst/set_monitor_params'
SET_NOISE_EQUATION_PARAMS_URL = '/burst/set_noise_equation_params'
SET_NOISE_PARAMS_URL = '/burst/set_noise_params'
SET_PSE_PARAMS_URL = '/burst/set_pse_params'
SET_STIMULUS_URL = '/burst/set_stimulus'
SET_SURFACE_URL = '/burst/set_surface'