Pre-defined Primitive Instructions
- ticktalkpython.Instructions.ABS(a)
Absolute value
- ticktalkpython.Instructions.ADD(a, b)
Addition (commutative)
- ticktalkpython.Instructions.CONST(trigger, const=None)
Generate a
TTToken
with the given constant value. Copy the timestamp from the trigger.
- ticktalkpython.Instructions.COPY_TTTIME(value_token, time_token, TTExecuteOnFullToken=True)
SQ that creates a new token with the value of one and the time tag of another. This may be challenging to work with when trying to synchronize the two together, at least if the value_token did not originate from the root of the graph, as the tokens will obviously not synchronize. This will also be problematic if they use different clocks
NB: This function operates on the tokens themselves. The optional argument ‘TTExecuteOnFullToken’ is not used; it is metasyntax telling the runtime to supply the full tokens instead of just the values.
- Parameters:
value_token (
TTToken
) – The token carrying the desired value for the output token.time_token – The token carrying the desired
TTTime
for the output token
- Returns:
A
TTToken
carrying the value of the first input and time of the second- Return type:
TTToken
- ticktalkpython.Instructions.DIV(a, b)
Division (NOT commutative)
- ticktalkpython.Instructions.MAX(a, b)
Maximum (commutative)
- ticktalkpython.Instructions.MIN(a, b)
Minimum (commutative)
- ticktalkpython.Instructions.MULT(a, b)
Multiplication (commutative)
- ticktalkpython.Instructions.NEG(a)
Aritmetic negation
- ticktalkpython.Instructions.READ_TTCLOCK(trigger, TTClock=None, TTExecuteOnFullToken=True)
Read a clock that is supplied as an input argument. The clock is supplied be the runtime environment, but the start and stop tick will be unchanged.
NB: This function operates on the tokens themselves. The optional argument ‘TTExecuteOnFullToken’ is not used; it is metasyntax telling the runtime to supply the full tokens instead of just the values.
- Parameters:
trigger (
TTToken
) – A token whose arrival will cause this SQ to run and record the current time in the ‘value’ field- Returns:
A token whose value is the current time according to the provided
TTClock
- Return type:
TTToken
- ticktalkpython.Instructions.SQRT(a)
Square root
- ticktalkpython.Instructions.SUB(a, b)
Subtraction (NOT commutative)
- ticktalkpython.Instructions.SYSLOG(a)
Print the argument as a debug message to the system log (debug only)
- ticktalkpython.Instructions.TIME_TOKEN(trigger)
Generate a
TTToken
with the given time value. Copy the value from the trigger. :param trigger: any token; value is ignored but time is copied to the output :type trigger: TTToken :param time: a TTTime :type const: TTTime :return: passthrough value with the trigger’sTTTime
:rtype: TTToken
- ticktalkpython.Instructions.TTTIME_TO_VALUES(token, TTExecuteOnFullToken=True)
Move the upper and lower bounds of the
TTTime
interval into the value field as a tuple (start, stop) ticks. TheTTClock
is not provided; the clock is not mutable, and should remain untouched. If it is modified, a runtime error is thrown since this has far reaching side effectsNB: This function operates on the tokens themselves. The optional argument is not used; it is metasyntax telling the runtime to supply the full tokens instead of just the values.
This instruction can only be used within a grpah that is compiled and run in the graph interpetation runtime environment
- Parameters:
token (
TTToken
) – The token whose timestamps must be moved to the value field. The time and tag are unchanged- Returns:
token whose value is a tuple containing two integers; the start and stop tick on
TTTime
part of the token.- Return type:
TTToken
- ticktalkpython.Instructions.TUPLE_2(a, b)
Return a tuple of the two arguments (debug only)
- ticktalkpython.Instructions.TUPLE_3(a, b, c)
Return a tuple of the two arguments (debug only)
- ticktalkpython.Instructions.VALUES_TO_TTTIME(start_tick_token, stop_tick_token, TTExecuteOnFullToken=True)
Set the start and stop ticks of the output token’s time field to be the values from the two inputs tokens; one is the start tick, the other is the stop tick. If the values are not integers or start >= stop, a ValueError is thrown.
NB: This function operates on the tokens themselves. The optional argument is not used; it is metasyntax telling the runtime to supply the full tokens instead of just the values.
- Parameters:
start_tick_token (
TTToken
) – A tokcn whose value field contains the start tick (in terms of the attached clock)stop_tick_token (
TTToken
) – A tokcn whose value field contains the stop tick (in terms of the attached clock)
- Returns:
A token with no value (None) and a
TTTime
whose start tick is the value of the first input and whose stop tick is the value of the second.- Return type:
TTToken