本文整理汇总了Python中model.Model.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Model.__init__方法的具体用法?Python Model.__init__怎么用?Python Model.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Model
的用法示例。
在下文中一共展示了Model.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, attrs = {}):
self.name = ''
self._klasses = None
self._fee = 0
self._alt_fee = 0
self._for_user = 0
Model.__init__(self,attrs)
示例2: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, topology, bead_repr=None):
"""Structure-based Model (SBM)
Parameters
----------
topology : mdtraj.Topology object
An mdtraj Topology object that describes the molecular topology.
bead_repr : str [CA, CACB]
A code specifying the desired coarse-grain mapping. The all-atom
to coarse-grain mapping.
Methods
-------
assign_* :
Methods assign which atoms have bonded constraints
(angle potentials, dihedral, etc.)
add_* :
Methods add potentials to the Hamiltonian.
"""
Model.__init__(self, topology, bead_repr=bead_repr)
self.Hamiltonian = potentials.StructureBasedHamiltonian()
self.mapping.add_atoms()
示例3: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, num_decs, num_objs, ga_func, model_instance, initial_pop=None):
Model.__init__(self)
self.initialize_decs(num_decs)
self.num_objs = num_objs
self.ga_func = ga_func
self.model_instance = model_instance
self.initial_pop = initial_pop
示例4: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, tracks=None, devices=None, transport=None,
view_scale=None, units=None, patch_bay=None):
Model.__init__(self)
# the file path to save to
self.path = None
# transport
if (transport is None):
transport = Transport()
self.transport = transport
# time scale
if (view_scale is None):
view_scale = ViewScale()
self.view_scale = view_scale
# devices
if (devices is None):
devices = DeviceAdapterList()
self.devices = devices
# a list of units on the workspace
if (units is None):
units = UnitList()
self.units = units
self.units.add_observer(self.on_change)
self.units.add_observer(self.update_transport_duration)
self.update_transport_duration()
# a list of connections between units
if (patch_bay is None):
patch_bay = PatchBay()
self.patch_bay = patch_bay
self.patch_bay.add_observer(self.on_change)
示例5: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self,name,updateRateHz,messagingbus,sendmessagesto):
print "Instantiating Force & Moment Test Model ",name
# Call superclass constructor
Model.__init__(self,name,updateRateHz,messagingbus,sendmessagesto)
# Member variables ----------------------------------------------------
# Inputs
self.timeOn = 0.0
self.timeOff = 0.0
self.forceStationInput = mat('0.0;0.0;0.0')
self.momentStationInput = mat('0.0;0.0;0.0')
self.forceStation = mat('0.0;0.0;0.0')
self.momentStation = mat('0.0;0.0;0.0')
# Register Input Parameters -------------------------------------------
# Input Parameter Name, Member Variable Name, Example of Type)
self.registerInputParam('forceStation', 'forceStationInput', self.forceStationInput )
self.registerInputParam('momentStation', 'momentStationInput', self.momentStationInput)
self.registerInputParam('timeOn', 'timeOn', self.timeOn)
self.registerInputParam('timeOff', 'timeOff', self.timeOff)
示例6: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, attrs = {}):
self._amount = Money(0)
self._date = datetime.datetime.now().date()
self.description = ''
self.done = False
self.daily_cash_closer = False
Model.__init__(self, attrs)
示例7: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, ckpt):
"""
**input : **
**Path to the ckpt file to use
"""
Model.__init__(self, training=False, ckpt=ckpt)
self.code = [c for c in "\n\n static int"]
示例8: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self):
Model.__init__(self)
self._edges = [(0, 1), (1, 2), (2, 3), (3, 0),
(0, 4), (1, 4), (2, 4), (3, 4)]
self._sides = [(0, 1, 4), (1, 2, 4), (2, 3, 4), (0, 3, 4)]
self._verts = np.float32([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0], [0.5, 0.5, 1]])
示例9: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, name='Unit', x=0, y=0, width=0, height=0, hue=None):
Model.__init__(self)
self._name = name
self._x = x
self._y = y
self._width = width
self._height = height
self._hue = hue
示例10: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, number, value=0.0, client=None):
self._client = None
self._number = number
self._value = 0.0
Model.__init__(self)
unit.Source.__init__(self)
self._source_type = 'midi'
self.client = client
self.value = value
示例11: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self,
box,
particles,
cells,
max_interactions,
interaction_energy,
interaction_range):
# Call base class constructor.
Model.__init__(self, box, particles, cells, max_interactions, interaction_energy, interaction_range)
示例12: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, user_size, item_size):
Model.__init__(self,
in_user = F.EmbedID(user_size, 100),
in_item = F.EmbedID(item_size, 100),
layer1 = F.Linear(100, 100),
layer2 = F.Linear(100, 100),
layer3 = F.Linear(100, 1)
)
self.user_size = user_size
self.item_size = item_size
示例13: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self):
Model.__init__(self)
self._edges = [(0, 1), (1, 2), (2, 3), (3, 0),
(4, 5), (5, 6), (6, 7), (7, 4),
(0, 4), (1, 5), (2, 6), (3, 7)]
self._sides = [(0, 1, 5, 4), (0, 4, 7, 3), (2, 3, 7, 6), (4, 5, 6, 7), (1, 2, 6, 5)]
self._verts = np.float32([[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0],
[0, 0, 1], [0, 1, 1], [1, 1, 1], [1, 0, 1]])
示例14: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self, data = {}):
self.student_id = None
self._student = None
self.for_id = None
self.for_type = ''
self._for = None
self._installments = None
self.info = ''
self.inactive = False
Model.__init__(self, data)
示例15: __init__
# 需要导入模块: from model import Model [as 别名]
# 或者: from model.Model import __init__ [as 别名]
def __init__(self,name,updateRateHz,messagingbus,sendmessagesto):
print "Instantiating Atmosphere Model ",name
# Call superclass constructor
Model.__init__(self,name,updateRateHz,messagingbus,sendmessagesto)
# Member variables ----------------------------------------------------
# Inputs
self.windVelNED = mat('0.0;0.0;0.0')
# Constants
self.adiabaticindex = 1.4 # of dry air
self.REARTH = 6369.0 # radius of the Earth (km)
self.GMR = 34.163195
self.sealevelStandardTemperature = 288.15 # sea-level temperature, kelvins
self.sealevelStandardPressure = 101325.0 # sea-level pressure, N/sq.m
self.sealevelStandardDensity = 1.225 # sea-level density, kg/cu.m
self.htab = [ 0.0, 11.0, 20.0, 32.0, 47.0, 51.0, 71.0, 84.852 ]
self.ttab = [ 288.15, 216.65, 216.65, 228.65, 270.65, 270.65, 214.65, 186.946 ]
self.ptab = [ 1.0, 2.2336110E-1, 5.4032950E-2, 8.5666784E-3, 1.0945601E-3, 6.6063531E-4, 3.9046834E-5, 3.68501E-6 ]
self.gtab = [ -6.5, 0.0, 1.0, 2.8, 0.0, -2.8, -2.0, 0.0 ]
# Received via message
self.altitude = 0.0
self.dcmBodyFromNED = mat([[0.,0.,0.],[0.,0.,0.],[0.,0.,0.]])
self.velECEFinBody = mat('0.;0.;0.')
# Internal
self.vwindmag = 0.0
self.speedofsound = 0.0
# Outputs
self.mach = 0.0
self.alpha = 0.0
self.beta = 0.0
self.density = 0.0
self.pressure = 0.0
self.temperature = 0.0
self.uvw = mat('0.0;0.0;0.0')
self.qbar = 0.0
self.qalpha = 0.0
# Register Input Parameters -------------------------------------------
# Input Parameter Name, Member Variable Name, Example of Type)
# None
self.registerInputParam('windVelNED', 'windVelNED', self.windVelNED )
# Register Input Messages ---------------------------------------------
#
self.mybus.register(self.name,'EOMstate')