#
msgid ""
msgstr ""
"Project-Id-Version: Modelica by Example 0.2.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-14 10:14-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../../source/components/architectures/replaceable.rst:4
msgid "Configuration Management"
msgstr "配置管理"

#: ../../source/components/architectures/replaceable.rst:7
msgid "``replaceable``"
msgstr ""

#: ../../source/components/architectures/replaceable.rst:9
msgid ""
"What really enables the configuration management features in Modelica is the"
" ``replaceable`` keyword.  It is used to identify components in a model "
"whose type can be changed (or \"redeclared\") in the future. One way to "
"think about ``replaceable`` is that it allows the model developer to define "
"\"slots\" in the model that are either \"blank\" to begin with (where an "
"interface model is the original type in the declaration) or at least "
"\"configurable\"."
msgstr ""
"真正让Modelica实现配置管理特性的是\ ``replaceable``\ 关键字。\ "
"此关键词是用以标记其类型在之后可以改变（或“重新声明”）的模型部件，。\ "
"一种理解\ ``replaceable``\ 的方法是，它允许模型开发人员在模型里定义插孔。\ "
"这些模型要么一张“白纸”（接口模型就是模型里定义的原始类型），或者最少是“可配置的”。\ "

#: ../../source/components/architectures/replaceable.rst:17
msgid ""
"The advantage of using the ``replaceable`` keyword is that it allows new "
"models to be created without having to reconnect anything.  This not only "
"imposes a structural framework on future models (to ensure naming "
"conventions are followed, interfaces are common, *etc.*), it also helps "
"avoid potential errors by eliminating an error prone task from the model "
"development process, *i.e.,* creating connections."
msgstr ""
"使用\\ ``replaceable``\\ "
"关键字的优点是，它允许不通过重新接线而创建新模型。\ "
"这不仅规定了未来模型的结构框架（可以确保命名惯例、共同接口等被遵守），这也有助于减少模型开发过程中的一种潜在错误：即创建连接。\ "

#: ../../source/components/architectures/replaceable.rst:25
msgid ""
"To make a component replaceable the only thing that is necessary is to add "
"the ``replaceable`` keyword in front of the declaration, *i.e.,*"
msgstr "要让组件变成可替换所须要做的唯一事情就是在声明前添加\\ ``replaceable``\\ 关键字，即："

#: ../../source/components/architectures/replaceable.rst:33
msgid ""
"where ``DeclaredType`` is the initial type for a variable named "
"``variableName``.  In such a declaration, the ``variableName`` variable can "
"be given a new type (we will discuss how very shortly). But any new type "
"used for ``variableName`` must be :ref:`plug-compatible <plug-"
"compatibility>`."
msgstr ""
"其中\\ ``DeclaredType``\\ 是名为\\ ``variableName``\\ 的变量其初始类型。\ "
"在这样的声明中，我们可以赋予\\ ``variableName``\\ 变量一个新类型（我们即将讨论详细的做法）。\ "
"但任何\\ ``variableName``\\ 使用的新类型必须\\ :ref:`\\ 插件兼容\\ <plug-compatibility>`\\ 于原类型。\ "

#: ../../source/components/architectures/replaceable.rst:42
msgid "``constrainedby``"
msgstr ""

#: ../../source/components/architectures/replaceable.rst:44
msgid ""
"As we just mentioned, by default the new type of any ``replaceable`` "
"component must be plug-compatible with the initial type.  But this doesn't "
"have to be the case.  As our earlier discussion on :ref:`constraining-types`"
" pointed out, it is possible to specify both a default type for the variable"
" to have and a separate constraining type that any new type needs to be "
"compatible with."
msgstr ""
"正如我们刚才提到的，默认情况下任何\\ ``replaceable``\\ "
"组件的新类型必须插件兼容于最初的类型。\ "
"但这种情况其实不一定必须的。\ "
"我们先前对\\ :ref:`constraining-types`\\ "
"的讨论已经指出，我们能够同时为变量指定一个缺省类型，以及一个独立约束类型，令替换的新类型必须与之兼容。\ "

#: ../../source/components/architectures/replaceable.rst:51
msgid ""
"Specifying an alternative constraining type requires the use of the "
"``constrainedby`` keyword.  The syntax for using the ``constrainedby`` "
"keyword is:"
msgstr "指定另外约束类型需要使用到\\ ``constrainedby``\\ 关键字。\ "
"使用\\ ``constrainedby``\\ 关键字语法如下："

#: ../../source/components/architectures/replaceable.rst:61
msgid ""
"where ``variableName`` is again the name of the variable being declared, "
"``DefaultType`` represents the type of ``variableName`` of the type of "
"``variableName`` is never changed and ``ConstrainingType`` indicates the "
"constraining type.  As mentioned previously, any new type attributed to the "
"``variableName`` variable must be plug-compatible with the constraining "
"type.  But, of course, the ``DefaultType`` must **also** be plug-compatible "
"with the constraining type."
msgstr ""
"其中\\ ``variableName``\\ 是前面变量声明的名字，\\ ``DefaultType``\\ 代表\\ "
"``variableName``\\ 类型。\ "
"\\ ``ConstrainingType``\\ 表示约束类型。\ "
"如前所述，\\ "
"``variableName``\\ 变量使用的任何新类型必须插件兼容于约束类型。\ "
"另外，当然\\ ``DefaultType``\\ **也**\\ "
"必须插件兼容于约束类型了。\ "

#: ../../source/components/architectures/replaceable.rst:0
msgid "``constrainedby`` vs. ``extends``"
msgstr ""

#: ../../source/components/architectures/replaceable.rst:72
msgid ""
"Older versions of Modelica didn't include the ``constrainedby`` keyword.  "
"Instead, the ``extends`` keyword was used instead.  But it was felt that "
"inheritance and plug-compatibility were distinct enough that a separate "
"keyword would be less confusing.  So don't be confused if you are looking at"
" Modelica code and the keyword ``extends`` is used where you would expect to"
" see the ``constrainedby`` keyword (*i.e.,* following a ``replaceable`` "
"declaration)."
msgstr ""
"旧版本的Modelica不包含\\ ``constrainedby``\\ 关键字。\ "
"有相同功能的是\\ ``extends``\\ 关键字。\ "
"但有人认为，继承和插件的兼容性截然不同，足矣用一个单独的关键字去减少混乱。\ "
"所以，如果一段Modelica代码里在本该出现\\ ``constrainedby``\\ 关键字的地方\ "
"（即在\\ ``replaceable``\\ 声明的后面）你却看到了\\ ``extends``\\ 关键字。\ "

#: ../../source/components/architectures/replaceable.rst:82
msgid "``redeclare``"
msgstr ""

#: ../../source/components/architectures/replaceable.rst:84
msgid ""
"So now we know that by using the ``replaceable`` keyword, we can change the "
"type of a variable in the future.  Changing the type is called "
"\"redeclaring\" the variable (*i.e.,* to have a different type). For this "
"reason, it is fitting that the keyword used to indicate a redeclaration is "
"``redeclare``.  Assume that we have the following system model:"
msgstr ""
"所以现在我们知道，通过使用\\ ``replaceable``\\ "
"关键字，可以让我们在之后改变一个变量的类型。\ "
"改变类型又称为“重新声明”变量（或者说声明为不同的类型）。\ "
"出于这个原因，用\\ ``redeclare``\\ 关键字指示重声明甚为恰当。\ "
"若我们有以下的系统模型："

#: ../../source/components/architectures/replaceable.rst:100
msgid ""
"In this ``System`` model, only the sensor is ``replaceable``.  So the types "
"of each of the other subsystems (*i.e.,* ``plant``, ``controller`` and "
"``actuator``) cannot be changed."
msgstr ""
"此\\ ``System``\\ 内只有传感器是\\ ``replaceable``\\ 。\ "
"因此，其他各子系统（即\\ ``plant``\\ 、\\ "
"``controller``\\ 、\\ ``actuator``\\ ）的类型不能改变。\ "

#: ../../source/components/architectures/replaceable.rst:104
msgid ""
"If we wanted to extend this model, but use a different model for the "
"``sensor`` subsystem, we would use the ``redeclare`` keyword as follows:"
msgstr "如果我们想在扩展这个模型时使用不同的\\ ``sensor``\\ 子系统模型，那我们会以如下方式使用\\ ``redeclare``\\ 关键字："

#: ../../source/components/architectures/replaceable.rst:116
msgid ""
"What this tells the Modelica compiler is that in the context of the "
"``SystemVariation`` model, the ``sensor`` subsystem should be an instance of"
" the ``CheapSensor`` model, not the (otherwise default) ``Sensor`` model.  "
"**However**, the ``CheapSensor`` model (or any other type chosen during "
"redeclaration) **must be plug-compatible with that variable's constraining "
"type**."
msgstr ""
"这告诉了Modelica语言编译器是在\\ ``SystemVariation``\\ 模型的上下文内，\\ ``sensor``\\ 子系统应该是\\"
" ``CheapSensor``\\ 模型的一个实例，而非（一般情况下默认的）\\ ``Sensor``\\ 模型。\ "
"\\ **但是**\\ ，\\ "
"``CheapSensor``\\ 模型（或重声明时选择的任何其他类型）\\ **必须插件兼容于该变量的约束类型**\\ 。\ "

#: ../../source/components/architectures/replaceable.rst:123
msgid ""
"The syntax of a ``redeclare`` statement is really exactly the same as a "
"normal declaration except that it is preceded by the ``redeclare`` keyword."
"  Obviously, any variable that is redeclared had to be declared in the first"
" place (*i.e.,* you cannot use this syntax to declare a variable, only to "
"*redeclare* it)."
msgstr ""
"\\ ``redeclare``\\ 语句的语法和正常的声明真的几乎完全一样。\ "
"唯一不同之处在于语句前面的\\ ``redeclare``\\ "
"关键字。\ "
"很明显，重新声明的任何变量必须事先曾被声明（即你不能使用此语法来声明一个变量，只能\\ *重声明*\\ 它）。\ "

#: ../../source/components/architectures/replaceable.rst:129
msgid ""
"It is **very important** to understand that when you redeclare a component, "
"the new redeclaration supersedes the previous one.  For example, after the "
"following redeclaration:"
msgstr "你重定义一个组件时，新的重声明会取代前面的重声明。\ "
"这点\\ **非常重要**\\ 。\ "
"例如，下面的重声明之后："

#: ../../source/components/architectures/replaceable.rst:137
msgid ""
"the ``sensor`` component **is no longer replaceable**.  This is because the "
"new declaration doesn't include the ``replaceable`` keyword.  As a result, "
"it is as if it was never there.  If we wanted the component to remain "
"replaceable, the redeclaration would need to be:"
msgstr ""
"\\ ``sensor``\\ 组件\\ **不再能被替换**\\ 。\ "
"原因是新的声明不包括\\ ``replaceable``\\ "
"关键字。\ "
"其结果是，此关键词虽然此前在最初的模型有定义，在所有以后的模型却如同不存在了。\ "
"如果我们希望部件以保持可替换，重新声明将需要写为："

#: ../../source/components/architectures/replaceable.rst:146
msgid ""
"Furthermore, if we choose to make the redeclared variable replaceable, we "
"also have the option **to redeclare the constraining type**, like this:"
msgstr "此外，如果我们重新将变量声明成可替换的，我们还可以选择\\ **重新声明约束类型**\\ ，如下："

#: ../../source/components/architectures/replaceable.rst:154
msgid ""
"However, the original constraining type still plays a role even in this case"
" because the type ``NewSensorType`` must be plug-compatible with the "
"original constraining type.  In the terminology of programming languages, we"
" can narrow the type (reducing the set of things that are plug-compatible), "
"but we can never widen the type (which would make things that were "
"previously not plug-compatible now plug-compatible)."
msgstr ""
"但是，原始约束类型哪怕在这种情况下仍然能发挥作用。\ "
"原因是新类型\\ ``NewSensorType``\\ 必须插件兼容于原始约束类型。\ "
"用编程语言的术语，我们能够收缩类型（减少插件兼容类型的种类），\ "
"而不能拓宽类型（将此前并非插件兼容的类型变为插件兼容）。\ "

#: ../../source/components/architectures/replaceable.rst:162
msgid ""
"Earlier, when discussing :ref:`arrays-of-components`, we made the point that"
" it was not possible to redeclare individual elements in arrays. Instead, a "
"redeclaration must be applied to the entire array.  In other words, if we "
"declare something initially as:"
msgstr ""
"此前在讨论\\ :ref:`arrays-of-components`\\ "
"时，我们指出了重新声明数组中的各个元素并不可能。\ "
"相反，重声明必须应用到整个数组。\ "
"换句话说，如果我们最初声明如下："

#: ../../source/components/architectures/replaceable.rst:171
msgid "It is then possible to redeclare the array, *e.g.,*"
msgstr "然后可以重新声明数组，例如："

#: ../../source/components/architectures/replaceable.rst:177
msgid ""
"But the important point is that the redeclaration affects every element of "
"the ``sensors`` array.  There is no way to redeclare only one element."
msgstr "但要注意，重新声明影响\\ ``sensors``\\ 数组中的每个元素。\ "
"仅仅重新定义一个元素是不可能的。\ "

#: ../../source/components/architectures/replaceable.rst:182
msgid "Modifications"
msgstr "修改"

#: ../../source/components/architectures/replaceable.rst:186
msgid ""
"One important complexity that comes with replaceability is what happens to "
"modifications in the case of a redeclaration.  To understand the issue, "
"consider the following example."
msgstr "可替换性带来的一个重要问题出现在有重声明时进行修改的情况下。\ "
"要理解这个问题，考虑下面的例子。\ "

#: ../../source/components/architectures/replaceable.rst:195
msgid "Now, what happens if we were to redeclare the ``sensor`` as follows:"
msgstr "现在，如果我们要以如下语句重定义\\ ``sensor``\\ ，会发生什么情况呢？"

#: ../../source/components/architectures/replaceable.rst:201
msgid ""
"Is the value for ``sample_rate`` lost?  We would hope so since the "
"``IdealSensor`` model probably doesn't have a ``parameter`` called "
"``sample_rate`` to set."
msgstr ""
"\\ ``sample_rate``\\ 值会消失么？我们希望如此。\ "
"因为\\ ``IdealSensor``\\ 模型可能不具有名为\\ "
"``sample_rate``\\ 的\\ ``parameter``\\ 以供修改。\ "

#: ../../source/components/architectures/replaceable.rst:205
msgid "But let's consider another case:"
msgstr "然而，让我们考虑另外一种情况："

#: ../../source/components/architectures/replaceable.rst:211
msgid ""
"Now imagine we had another resistor model, ``SensitiveResistor`` that was "
"plug-compatible with ``Resistor`` (*i.e.,* it had a ``parameter`` called "
"``R``) but included an additional parameter, ``dRdT``, indicating the "
"(linear) sensitivity of the resistance to temperature. We might want to do "
"something like this:"
msgstr ""
"现在想象我们有另外一个电阻器模型\\ ``SensitiveResistor``\\ 。\ "
"而这个模型插件兼容于\\ ``Resistor``\\ "
"（即它有一个名为\\ ``R``\\ 的\\ ``parameter``\\ ）。\ "
"但模型也包括一个额外的参数\\ ``dRdT``\\ "
"，以指示电阻的（线性）温度敏感度。\ "
"我们可能想要做这样的事情："

#: ../../source/components/architectures/replaceable.rst:221
msgid ""
"What happens to ``R`` in this case?  In this case, we would actually like to"
" preserve the value of ``R`` so it persists across the redeclaration.  "
"Otherwise, we'd need to restate it all the time, *i.e.,*"
msgstr ""
"\\ ``R``\\ 在这种情况下会如何呢？在这里，我们实际上希望保持\\ ``R``\\ "
"的值，让其在整个重声明仍然存在。\ "
"否则，我们就需要不断重申这点，即："

#: ../../source/components/architectures/replaceable.rst:230
msgid ""
"and this would violate the DRY principle.  The result would be that any "
"change in the original value of ``R`` would be overridden by any "
"redeclarations."
msgstr "这就会违反DRY原则。\ "
"其结果将是，在\\ ``R``\\ 原始值的任何改变都会被任意的重声明所覆盖。\ "

#: ../../source/components/architectures/replaceable.rst:234
msgid ""
"So, we've seen two cases valid use cases.  In one case, we don't want a "
"modification to persist following a redeclaration and in the other we would "
"like the modification to persist.  Fortunately, Modelica has a way to "
"express both of these.  The normal Modelica semantics take care of the first"
" case.  If we redeclare something, all modifications from the original "
"declaration are erased.  But what about the second case?  In that case, the "
"solution is to **apply the modifications to the constraining type**.  So for"
" our resistor example, our original declaration would need to be:"
msgstr ""
"因此，我们已经看到了两个有效用例。\ "
"在一种情况下，我们不希望在重声明后保留修改。\ "
"在另一个例子里，我们则想保留修改。\ "
"幸好，Modelica语言可以方法可以表达这两种需求。\ "
"正常的Modelica语义可用于第一种情况。\ "
"在重定义时，原声明中的所有修改都会被去除。\ "
"至于第二种情况呢？解决方案是\\"
" **应用约束类型上的修改**\\ 。\ "
"因此，以前面的电阻为例，原来的声明将要修改为："

#: ../../source/components/architectures/replaceable.rst:248
msgid ""
"Here we explicitly list both the default type ``Resistor`` and the "
"constraining type ``Resistor(R=100)`` separately because the constraining "
"type now includes a modification.  By moving the modification to the "
"constraining type, **that modification will automatically be applied to both"
" the original declaration and any subsequent redeclarations**.  So in this "
"case, the resistor instance ``R1`` will have an ``R`` value of ``100`` even "
"though the modification isn't directly applied after the variable name.  But"
" furthermore, if we perform the redeclaration we discussed previously, "
"*i.e.,*"
msgstr ""
"在这里我们单独地明确列出默认类型\\ ``Resistor``\\ 以及约束类型\\ ``Resistor(R=100)``\\ "
"。\ "
"原因是约束类型现在包含了修改。\ "
"这样将修改移动到约束类型后，\\ **该修改会自动应用到原来的声明以及随后的重声明里**\\ "
"。\ "
"因此，在这种情况下，电阻器实例\\ ``R1``\\ 的\\ ``R``\\ 值为\\ ``100``\\ "
"。\ "
"即便修改不直接加在变量名后。\ "
"而此外，如果我们进行前述的重声明，即："

#: ../../source/components/architectures/replaceable.rst:262
msgid "the ``R=100`` modification will automatically be applied here as well."
msgstr "\\ ``R=100``\\ 修改也会自动应用于此"

#: ../../source/components/architectures/replaceable.rst:264
msgid ""
"In summary, if you want a modification to apply only to a specific "
"declaration and not in subsequent redeclarations, apply it after the "
"variable name.  If you want it to persist through subsequent redeclarations,"
" apply it to the constraining type."
msgstr ""
"总之，如果你想修改只应用于特定的声明不影响随后的重声明，那么应该将修改附加在变量名。\ "
"如果你想让修改持续影响随后的重声明，就应将其附加到约束型后。\ "

#: ../../source/components/architectures/replaceable.rst:272
msgid "Redefinitions"
msgstr "重定义"

#: ../../source/components/architectures/replaceable.rst:274
msgid ""
"It turns out that the ``replaceable`` keyword can also be associated with "
"*definitions*, not just declarations.  The main use of this feature is to be"
" able to change the type of **multiple** components at once.  For example, "
"imagine a circuit model with several different resistor components:"
msgstr ""
"另外，\\ ``replaceable``\\ 关键字不仅可以和声明相关联，也可以与\\ *定义*\\ 有关。\ "
"此功能的主要用途是一次性改变\\ "
"**多个**\\ 组件的类型。\ "
"举个例子，假设电路模型有数个不同的电阻元件："

#: ../../source/components/architectures/replaceable.rst:294
msgid ""
"Now imagine we wanted one version of this model with ordinary ``Resistor`` "
"components and the other where each resistor was an instance of the "
"``SensitiveResistor`` model.  One way we could achieve this would be to "
"define our ``Circuit`` as follows:"
msgstr ""
"现在想象一下，我们希望这个模型有一个版本使用普通的\\ ``Resistor``\\ 组件。\ "
"而另一个版本里，每个电阻均为\\ "
"``SensitiveResistor``\\ 模型的实例。\ "
"为此，其中一种方法是定义我们的\\ ``Circuit``\\ 如下："

#: ../../source/components/architectures/replaceable.rst:313
msgid ""
"But in that case, our circuit with ``SensitiveResistor`` components would be"
" defined as:"
msgstr "但在这种情况下，带有\\ ``SensitiveResistor``\\ 组件的电路将定义为："

#: ../../source/components/architectures/replaceable.rst:327
msgid ""
"Note that we don't have to specify resistance values because the "
"modifications that set the resistance were applied to the constraining type "
"in our ``Circuit`` model.  But, it is a bit tedious that we have to change "
"each individual resistor and specify ``dRdT`` over and over again even "
"though they are all the same value.  However, Modelica gives us a way to do "
"them all at once.  The first step is to define a local type within the model"
" like this:"
msgstr ""
"注意，我们不必另外指定电阻值。\ "
"原因是电阻的设置是附加在\\ ``Circuit``\\ "
"模型的约束类型上的。\ "
"但我们必须一而再地改变每个电阻模型然后指定\\ ``dRdT``\\ ，即便取值均是一样的。\ "
"这多少有些无趣。\ "
"不过， Modelica提供了一种方法去一次性修改所有部件。\ "
"首先，在模型内定义一个本地类型："

#: ../../source/components/architectures/replaceable.rst:350
msgid ""
"What this does is establish ``ResistorModel`` as a kind of alias for "
"``Resistor``.  This by itself doesn't help us with changing the type of each"
" resistor easily.  But making ``ResistorModel`` ``replaceable`` does:"
msgstr ""
"这样做是为了帮\\ ``Resistor``\\ 创建别名\\ ``ResistorModel``\\ "
"。\ "
"这本身并不能帮助我们一次性改变每个电阻的类型。\ "
"但通过将\\ ``ResistorModel``\\ 变为\\ ``replaceable``\\ 则可以做到这点："

#: ../../source/components/architectures/replaceable.rst:370
msgid ""
"If our ``Circuit`` is defined in this way, we can create the "
"``SensitiveCircuit`` model as follows:"
msgstr "若我们的\\ ``Circuit``\\ 模型定义如上，那么就可以创建如下的\\ ``SensitiveCircuit``\\ 模型："

#: ../../source/components/architectures/replaceable.rst:381
msgid ""
"All our resistor components are still of type ``ResistorModel``, we didn't "
"have to redeclare any of them.  What we **did do** was redefine what a "
"``ResistorModel`` is by changing its definition to "
"``SensitiveResistor(dRdT=0.1)``.  Note that the modification ``dRdT=0.1`` "
"will be applied to all components of type ``ResistorModel``.  Technically, "
"this isn't a redeclaration of a component's type, it is a redefinition of a "
"type.  But we reuse the ``redeclare`` keyword."
msgstr ""
"所有的电阻元件类型仍为\\ ``ResistorModel``\\ ，我们没有必要重声明任何一个元素。\ "
"通过将\\ ``ResistorModel``\\"
" 类型定义改变为\\ ``SensitiveResistor(dRdT=0.1)``\\ ，我们\\ **做到了**\\ 重新定义什么是\\ "
"``ResistorModel``\\ 。\ "
"注意，\\ ``dRdT=0.1``\\ 这一更改将应用到类型为\\ ``ResistorModel``\\ "
"的所有组件。\ "
"从技术上讲，这不是组件类型的重声明，而是一个类型的重定义。\ "
"但是，我们再次使用了\\ ``redeclare``\\ 关键字。\ "

#: ../../source/components/architectures/replaceable.rst:390
msgid ""
"Interestingly, with these redefinitions we still have the notion of a "
"default type and a constraining type.  The general syntax for a redefinable "
"type is:"
msgstr "有趣的是，这些重定义仍然有默认类型和约束类型的概念。\ "
"重定义类型的一般语法为："

#: ../../source/components/architectures/replaceable.rst:398
msgid ""
"Just as with a replaceable component, any modifications associated with the "
"default type, ``DefaultType``, are only applied in the case that "
"``AliasType`` isn't redefined.  But, any modification associated with the "
"constraining type, ``ConstrainingType``, will persist across redefinitions."
"  Furthermore, ``AliasType`` must always be plug compatible with the "
"constraining type."
msgstr ""
"正如可替换组件的情况一样，任何对默认类型\\ ``DefaultType``\\ 进行的修改，\ "
"只会在不重新定义\\ ``AliasType``\\ 的情况下有效。\ "
"不过，任何对约束型\\ ``ConstrainingType``\\ 进行的修改，都会在重定义之后会继续有效。\ "
"此外，\\ ``AliasType``\\ 必须总是插件兼容于约束类型。\ "

#: ../../source/components/architectures/replaceable.rst:405
msgid ""
"Although this aspect of the language is less frequently used, compared to "
"replaceable components, it can save time and help avoid errors in some "
"cases."
msgstr "虽然相对于可更换组件，语言的这个特性使用并不太频繁。\ "
"但这个特性可以节省时间，并有助于避免在特定情况下的错误。\ "

#: ../../source/components/architectures/replaceable.rst:410
msgid "Choices"
msgstr "选择"

#: ../../source/components/architectures/replaceable.rst:412
msgid ""
"This section has focused on configuration management and we've learned that "
"the constraining type controls what options are available when doing a "
"``redeclare``.  If a single model developer creates an architecture and all "
"compatible implementations, then they have a very good sense of what "
"potential configurations will satisfy the constraining types involved."
msgstr ""
"这部分重点是配置管理。\ "
"我们已经了解到，约束类型决定\\ ``redeclare``\\ "
"时可选的模型。\ "
"如果由一个模型开发人员同时创建架构模型以及所有兼容的实现，那么他会知道需要使用什么约束类型匹配潜在的配置。\ "

#: ../../source/components/architectures/replaceable.rst:419
msgid ""
"But what if you are using an architecture developed by someone else? How can"
" you determine what possibilities exist?  Fortunately, the Modelica "
"specification includes a few standard annotations that help address this "
"issue."
msgstr "但如果你在使用的是由别人开发的架构模型呢？你如何确定存在哪些可能模型呢？好在Modelica语言规范包括一些标准标注以解决这一问题。\ "

#: ../../source/components/architectures/replaceable.rst:425
msgid "``choices``"
msgstr ""

#: ../../source/components/architectures/replaceable.rst:427
msgid ""
"The ``choices`` annotation allows the original model developer to associate "
"a list of modifications with a given declaration.  The very simplest use "
"case for this could be to specify values for a given parameter:"
msgstr "\\ ``choices``\\ 标注允许原模型的开发者将给定声明和一系列修改相关联。\ "
"在最简单的情况下，用户可以为特定参数指定不同的值："

#: ../../source/components/architectures/replaceable.rst:438
msgid ""
"In this case, the model developer has listed several possible values that "
"the user might want to give to the ``rho`` parameter.  Each choice is a "
"modification to be applied to the ``rho`` variable.  This information is "
"commonly used by graphical Modelica tools to provide users with intelligent "
"choices."
msgstr ""
"在本例，模型开发者为\\ ``rho``\\ 参数列出了几个用户可能使用的赋值。\ "
"而上述每个选项均为对\\ ``rho``\\ "
"变量的修改。\ "
"此信息常用在图形化的Modelica工具里，目的是为用户提供智能化的选项。\ "

#: ../../source/components/architectures/replaceable.rst:444
msgid ""
"This feature can just as easily be used in the context of configuration "
"management.  Consider the following example:"
msgstr "这个功能也可以很容易地在配置管理的情况中使用。\ "
"请看下面的例子："

#: ../../source/components/architectures/replaceable.rst:457
msgid ""
"Again, the model developer is embedding a set of possible modifications "
"along with the declaration.  These ``choice`` values can also be used by "
"graphical tools to provide a reasonable set of choices when configuring a "
"system."
msgstr "同样，模型开发者可以将一组可能的修改连同声明一起。\ "
"在使用图形工具时，这些\\ ``choice``\\ 值可为用户提供一套合理的选项去配置系统。\ "

#: ../../source/components/architectures/replaceable.rst:463
msgid "``choicesAllMatching``"
msgstr ""

#: ../../source/components/architectures/replaceable.rst:465
msgid ""
"But one problem here is that it is not only tedious to have to explicitly "
"list all of these choices, but the set of possibilities might change.  After"
" all, other developers (besides the original model developer) might come "
"along and create implementations that satisfy a given constraining type.  "
"How about giving users the option of seeing **all** legal options when "
"configuring their system?"
msgstr ""
"不过，这里有一个问题。\ "
"要明确列出所有这些选择不仅麻烦，而且适合的模型选项也可能会改变。\ "
"毕竟，其他开发人员（原始模型开发者以外的人）也可能去创建某个特定约束型的实现。\ "
"为何不让用户在配置自己的系统时可以选择见到\\"
" **所有的**\\ 合规选项呢？"

#: ../../source/components/architectures/replaceable.rst:472
msgid ""
"Fortunately, Modelica includes just such an annotation.  It is the "
"``choicesAllMatching`` annotation.  By setting the value of this annotation "
"to ``true`` on a given declaration (or ``replaceable`` definition), this "
"instructs the tool to find all possible legal options and present them "
"through the user interface.  For example,"
msgstr ""
"好在Modelica正正包含了这样的标注。\ "
"这个标注就是\\ ``choicesAllMatching``\\ 。\ "
"只要在给定的声明（或\\ "
"``replaceable``\\ 定义）将此标注设置为\\ ``True``\\ "
"，Modelica工具就会因此而查找所有合规的选项，并将其展现在用户界面上。\ "
"例如，"

#: ../../source/components/architectures/replaceable.rst:483
msgid ""
"By adding this annotation, the tool knows to find all legal redeclarations "
"when a user is reconfiguring their models through the graphical user "
"interface.  This can increase the usability of architecture based models "
"**enormously** because it presents users with the full range of options at "
"their disposal with trivial effort on the part of the model developer."
msgstr ""
"通过添加此标注，建模工具会在用户用图形界面重新配置他们的模型时找到所有合规的重声明模型。\ "
"这大大可以增加\\ **架构模型**\\ 的实用性。\ "
"原因是，此标注在稍微增加模型开发者的工作量的前提下为用户提供了全方位的选择。\ "

#: ../../source/components/architectures/replaceable.rst:491
msgid "Conclusion"
msgstr "结论"

#: ../../source/components/architectures/replaceable.rst:493
msgid ""
"In this section, we've discussed the configuration management features in "
"Modelica.  As with other aspects of the Modelica language, the goals here "
"are the same: promote reuse, increase productivity and ensure correctness.  "
"Modelica includes many powerful options for redeclaring components and "
"redefining types.  By combining this with the ``choicesAllMatching`` "
"annotation, models can be built to support a large combination of possible "
"configurations using clearly defined choice points."
msgstr ""
"在本节中，我们讨论了Modelica的配置管理功能。\ "
"本功能与Modelica其他的方面有着相同目标：促进重用，提高生产效率，并确保正确性。\ "
"Modelica的包括许多功能强大的选项去进行组件重声明以及类型重定义。\ "
"将这点与\\ ``choicesAllMatching``\\ 标注结合，模型可以用一些明确的选项去支持大量的配置。\ "
