|
The
Potential
class manages a list of Energy
objects. An instance of this class (the Energy
list) should be created and each Energy object
should be registered with this list. This list is
in turn usually registered with an instance of the
Model
class.
Location
The
Potential
module is located in Yup.Taro.
Data
Attributes
The
following data attributes are writeable. For
example: if P is a
Potential
object, P.numcalls
is the value of the numcalls
attribute of P and
"P.numcalls
=
0" sets the numcalls
attribute to a new value (0).
|
Data
Attribute
|
Description
|
|
numcalls
|
This
is a counter. Each time the
evaluate()
method is applied to the Energy objects
this is incremented by one (regardless
of the value of
numterms).
|
|
width
|
The
width of a column of numbers. If set
below 8, the output is as wide as
needed and columns are separated by the
tab character. If set to 8 or higher,
numbers are formatted to fit in
width-2
characters. The remaining space is
filled with a trailing
blank.
|
The
following data attributes are read-only. These
attributes should not be assigned new values. If
you do assign to these attributes the old values
will be "covered" by your definition and further
use of the object will likely fail. To recover from
this stupidity, delete the attribute.
|
Data
Attribute
|
Description
|
|
banner
|
A
text string that is the concatenation
of the label
attributes of all the objects that make
up the Energy list. This is formatted
according to the
width
setting. If a
label
is too wide, the excess characters are
not included and the truncation is
indicated by the character "&".
|
|
values
|
A
text string containing the values of
the energy of each of the objects that
make up the Energy list. This is
formatted according to the
width
setting.
|
|
MEMBERS
|
The
Energy list
|
|
RESULTS
|
A
list of numbers. These are the energy
values of the objects in the Energy
list. This is in contrast to
values
which is a single string containing all
the values.
|
|
numterms
|
The
number of items in the Energy
list.
|
Methods
There
are three methods.
The
add_term()
method adds the given object to the end of the
Energy list. The specified object must be an
Energy
object.
|
Method
Name
|
Number
of Arguments
|
Return
Value
|
|
add_term
|
1
|
None
|
|
Keyword
|
Argument
Type
|
Preset
Value
|
|
term
|
Energy
object
|
-
|
The
remove_term()
method finds the first instance of the Energy
object (starting from the top of the Energy list)
that has the label specified in the argument and
removes it from the list.
|
Method
Name
|
Number
of Arguments
|
Return
Value
|
|
remove_term
|
1
|
None
|
|
Keyword
|
Argument
Type
|
Preset
Value
|
|
label
|
character
string
|
-
|
The
get_term()
method finds the first instance of the Energy
object (starting from the top of the Energy list)
that has the label specified in the argument and
returns the object. This is useful if you have lost
all other references to the Energy
object.
|
Method
Name
|
Number
of Arguments
|
Return
Value
|
|
get_term
|
1
|
Energy
object
|
|
Keyword
|
Argument
Type
|
Preset
Value
|
|
label
|
character
string
|
-
|
|