本文整理汇总了Python中amuse.community.interface.common.CommonCode.define_state方法的典型用法代码示例。如果您正苦于以下问题:Python CommonCode.define_state方法的具体用法?Python CommonCode.define_state怎么用?Python CommonCode.define_state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类amuse.community.interface.common.CommonCode
的用法示例。
在下文中一共展示了CommonCode.define_state方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: define_state
# 需要导入模块: from amuse.community.interface.common import CommonCode [as 别名]
# 或者: from amuse.community.interface.common.CommonCode import define_state [as 别名]
def define_state(self, object):
CommonCode.define_state(self, object)
object.add_transition('INITIALIZED','EDIT','commit_parameters')
object.add_transition('RUN','CHANGE_PARAMETERS_RUN','before_set_parameter', False)
object.add_transition('EDIT','CHANGE_PARAMETERS_EDIT','before_set_parameter', False)
object.add_transition('UPDATE','CHANGE_PARAMETERS_UPDATE','before_set_parameter', False)
object.add_transition('CHANGE_PARAMETERS_RUN','RUN','recommit_parameters')
object.add_transition('CHANGE_PARAMETERS_EDIT','EDIT','recommit_parameters')
object.add_transition('CHANGE_PARAMETERS_UPDATE','UPDATE','recommit_parameters')
object.add_method('CHANGE_PARAMETERS_RUN', 'before_set_parameter')
object.add_method('CHANGE_PARAMETERS_EDIT', 'before_set_parameter')
object.add_method('CHANGE_PARAMETERS_UPDATE','before_set_parameter')
object.add_method('CHANGE_PARAMETERS_RUN', 'before_get_parameter')
object.add_method('CHANGE_PARAMETERS_EDIT', 'before_get_parameter')
object.add_method('CHANGE_PARAMETERS_UPDATE','before_get_parameter')
object.add_method('RUN', 'before_get_parameter')
object.add_method('EDIT', 'before_get_parameter')
object.add_method('UPDATE','before_get_parameter')
object.add_method('EDIT', 'new_particle')
object.add_method('EDIT', 'delete_particle')
object.add_method('UPDATE', 'new_particle')
object.add_method('UPDATE', 'delete_particle')
object.add_transition('EDIT', 'RUN', 'commit_particles')
object.add_transition('RUN', 'UPDATE', 'new_particle', False)
object.add_transition('RUN', 'UPDATE', 'delete_particle', False)
object.add_transition('UPDATE', 'RUN', 'recommit_particles')
object.add_method('RUN', 'calculate_densities')
object.add_method('RUN', 'do_hop')
object.add_method('RUN', 'get_mass')
object.add_method('RUN', 'get_position')
object.add_method('RUN', 'get_density')
object.add_method('RUN', 'get_group_id')
示例2: define_state
# 需要导入模块: from amuse.community.interface.common import CommonCode [as 别名]
# 或者: from amuse.community.interface.common.CommonCode import define_state [as 别名]
def define_state(self, object):
CommonCode.define_state(self, object)
for method_name in [
'initialize_from_dyn',
'initialize_from_elements',
'transform_to_time',
'advance_to_radius',
'return_to_radius',
'advance_to_periastron',
'advance_to_apastron',
'return_to_periastron',
'return_to_apastron',
'get_total_mass',
'get_time',
'get_period',
'get_elements',
'get_integrals',
'get_separation_vector',
'get_separation',
'set_periastron',
'get_periastron',
'get_apastron',
'get_velocity_vector',
'get_angles',
'set_longitudinal_unit_vector',
'set_normal_unit_vector',
'get_longitudinal_unit_vector',
'get_transverse_unit_vector',
'set_transverse_unit_vector',
'get_normal_unit_vector',
'print_all',
'set_random',
'get_random',
'make_binary_scattering']:
object.add_method('!UNINITIALIZED!END', method_name)
示例3: define_state
# 需要导入模块: from amuse.community.interface.common import CommonCode [as 别名]
# 或者: from amuse.community.interface.common.CommonCode import define_state [as 别名]
def define_state(self, object):
CommonCode.define_state(self, object)
object.add_transition('INITIALIZED','EDIT','commit_parameters')
object.add_transition('RUN','CHANGE_PARAMETERS_RUN','before_set_parameter', False)
object.add_transition('EDIT','CHANGE_PARAMETERS_EDIT','before_set_parameter', False)
object.add_transition('UPDATE','CHANGE_PARAMETERS_UPDATE','before_set_parameter', False)
object.add_transition('CHANGE_PARAMETERS_RUN','RUN','recommit_parameters')
object.add_transition('CHANGE_PARAMETERS_EDIT','EDIT','recommit_parameters')
object.add_transition('CHANGE_PARAMETERS_UPDATE','UPDATE','recommit_parameters')
object.add_method('CHANGE_PARAMETERS_RUN', 'before_set_parameter')
object.add_method('CHANGE_PARAMETERS_EDIT', 'before_set_parameter')
object.add_method('CHANGE_PARAMETERS_UPDATE','before_set_parameter')
object.add_method('CHANGE_PARAMETERS_RUN', 'before_get_parameter')
object.add_method('CHANGE_PARAMETERS_EDIT', 'before_get_parameter')
object.add_method('CHANGE_PARAMETERS_UPDATE','before_get_parameter')
object.add_method('RUN', 'before_get_parameter')
object.add_method('EDIT', 'before_get_parameter')
object.add_method('UPDATE','before_get_parameter')
object.add_method('EVOLVED','before_get_parameter')
object.add_method('EDIT', 'new_gas_particle')
object.add_method('EDIT', 'remove_gas_particle')
object.add_method('EDIT', 'new_src_particle')
object.add_method('EDIT', 'remove_src_particle')
object.add_transition('EDIT', 'RUN', 'commit_particles')
object.add_transition('RUN', 'UPDATE', 'new_gas_particle', False)
object.add_transition('RUN', 'UPDATE', 'remove_gas_particle', False)
object.add_transition('RUN', 'UPDATE', 'new_src_particle', False)
object.add_transition('RUN', 'UPDATE', 'remove_src_particle', False)
object.add_transition('RUN', 'UPDATE', 'set_pos_gas', False)
object.add_transition('RUN', 'UPDATE', 'set_rho_gas', False)
object.add_transition('RUN', 'UPDATE', 'set_hsml_gas', False)
object.add_transition('RUN', 'UPDATE', 'set_u_gas', False)
object.add_transition('RUN', 'UPDATE', 'set_dudt_gas', False)
object.add_transition('RUN', 'UPDATE', 'set_state_gas', False)
object.add_transition('RUN', 'UPDATE', 'set_state_src', False)
object.add_transition('RUN', 'UPDATE', 'set_luminosity_src', False)
object.add_transition('UPDATE', 'RUN', 'recommit_particles')
object.add_method('RUN', 'evolve_model')
object.add_method('RUN', 'get_state_gas')
object.add_method('RUN', 'get_state_src')
object.add_method('INITIALIZED', 'set_momentum_kicks')
object.add_method('INITIALIZED', 'set_isothermal')
object.add_method('INITIALIZED', 'set_boxsize')
object.add_method('INITIALIZED', 'set_globalHefraction')
object.add_method('INITIALIZED', 'set_raynumber')
object.add_method('INITIALIZED', 'set_iontempsolver')
object.add_method('INITIALIZED', 'set_boundary')
object.add_method('INITIALIZED', 'set_H_caseA')
object.add_method('INITIALIZED', 'set_He_caseA')
示例4: define_state
# 需要导入模块: from amuse.community.interface.common import CommonCode [as 别名]
# 或者: from amuse.community.interface.common.CommonCode import define_state [as 别名]
def define_state(self, object):
CommonCode.define_state(self, object)
object.add_transition("INITIALIZED", "EDIT", "commit_parameters")
object.add_transition("EDIT", "CHANGE_PARAMETERS_EDIT", "before_set_parameter", False)
object.add_transition("CHANGE_PARAMETERS_EDIT", "EDIT", "recommit_parameters")
object.add_method("CHANGE_PARAMETERS_EDIT", "before_set_parameter")
object.add_method("CHANGE_PARAMETERS_EDIT", "before_get_parameter")
object.add_method("RUN", "before_get_parameter")
object.add_method("EDIT", "before_get_parameter")
object.add_transition("EDIT", "RUN", "generate_particles", False)
object.add_transition("RUN", "EDIT", "clear_particle_set")
object.add_method("EDIT", "get_number_of_particles_updated")
object.add_method("RUN", "get_number_of_particles_updated")
object.add_method("RUN", "get_state")
示例5: define_state
# 需要导入模块: from amuse.community.interface.common import CommonCode [as 别名]
# 或者: from amuse.community.interface.common.CommonCode import define_state [as 别名]
def define_state(self, object):
CommonCode.define_state(self, object)
object.add_transition("INITIALIZED", "EDIT", "commit_parameters")
object.add_transition("RUN", "CHANGE_PARAMETERS_RUN", "before_set_parameter", False)
object.add_transition("EDIT", "CHANGE_PARAMETERS_EDIT", "before_set_parameter", False)
object.add_transition("UPDATE", "CHANGE_PARAMETERS_UPDATE", "before_set_parameter", False)
object.add_transition("CHANGE_PARAMETERS_RUN", "RUN", "recommit_parameters")
object.add_transition("CHANGE_PARAMETERS_EDIT", "EDIT", "recommit_parameters")
object.add_transition("CHANGE_PARAMETERS_UPDATE", "UPDATE", "recommit_parameters")
object.add_method("CHANGE_PARAMETERS_RUN", "before_set_parameter")
object.add_method("CHANGE_PARAMETERS_EDIT", "before_set_parameter")
object.add_method("CHANGE_PARAMETERS_UPDATE", "before_set_parameter")
object.add_method("CHANGE_PARAMETERS_RUN", "model_present")
object.add_method("CHANGE_PARAMETERS_EDIT", "model_present")
object.add_method("CHANGE_PARAMETERS_UPDATE", "model_present")
object.add_method("INITIALIZED", "model_present")
object.add_method("CHANGE_PARAMETERS_RUN", "before_get_parameter")
object.add_method("CHANGE_PARAMETERS_EDIT", "before_get_parameter")
object.add_method("CHANGE_PARAMETERS_UPDATE", "before_get_parameter")
object.add_method("RUN", "before_get_parameter")
object.add_method("EDIT", "before_get_parameter")
object.add_method("UPDATE", "before_get_parameter")
object.add_transition("EDIT", "UPDATE", "generate_particles", False)
object.add_transition("UPDATE", "RUN", "update_particle_set")
object.add_transition("RUN", "EDIT", "clear_particle_set")
object.add_method("RUN", "invoke_state_change_updated")
object.add_method("EDIT", "get_number_of_particles_updated")
object.add_method("UPDATE", "get_number_of_particles_updated")
object.add_method("RUN", "get_number_of_particles_updated")
object.add_method("RUN", "get_number_of_particles")
object.add_method("RUN", "get_mass")
object.add_method("RUN", "get_position")
object.add_method("RUN", "get_velocity")