setInitValue
to change the default value, and setAttibututes
and clearAttributes
to modify attributes.When creating new stars derived from stars already in the system, you will often also wish to customize them by adding new ports or states. In addition, you may wish to remove ports or states. Although, strictly speaking, you cannot do this, you can achieve the desired effect by simply hiding them from the user.
The following code will hide a particular state named
statename
from the user:
pigi
, statename will not appear as one of the parameters of the star. Of course, the state can still be set and used within the code defining the star.The same effect can be achieved with outputs or inputs. For instance, given an output named
output
, you can use the following code:
output
is a multiporthole, because this means simply that there will be zero instances of the individual portholes.This technique can also be used to hide individual portholes, however, the porthole will still be present, so it must be used with caution. Most domains do not allow disconnected portholes, and will flag an error. You can explicitly connect the port within the body of the star (see the kernel manual).