Pre-defined Primitive Instructions
- ticktalkpython.Instructions.ABS(a)
Absolute value
- ticktalkpython.Instructions.ADD(a, b)
Addition (commutative)
- ticktalkpython.Instructions.ADD_TIME_DELAY(token, delay=0, TTExecuteOnFullToken=True)
Modifies the start and end tick of the tine interval of the token to be delayed by parameter delay.
- Parameters:
value_token – The token carrying the desired value for the output token.
delay (int) – the specified delay
- Returns:
A
TTToken
with time interval [x, y] as [x + delay, y + delay]- Return type:
TTToken
- 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.DEADLINE(x, TTTimeDeadline=None)
Building block in implementing TTFinishByOtherwise. Programmer direct use is highly discouraged.
- Parameters:
- Returns:
signal to either run Plan B or an identity of the data token
- Return type:
- ticktalkpython.Instructions.DIV(a, b)
Division (NOT commutative)
- ticktalkpython.Instructions.EQ(a, b)
Equality (commutative)
- ticktalkpython.Instructions.GET_INFINITY(trigger, TTClock=None)
Return the maxiumum timestamp supported by the system. Note that the trigger value is unused.
- Parameters:
trigger (Not used) – Not used
- Returns:
A
TTToken
carrying the value of the maximum timestamp.- Return type:
TTToken
- ticktalkpython.Instructions.GET_NEG_INFINITY(trigger, TTClock=None)
Return the minimum timestamp supported by the system. Note that the trigger value is unused.
- Parameters:
trigger (Not used) – Not used
- Returns:
A
TTToken
carrying the value of the minimum timestamp.- Return type:
TTToken
- ticktalkpython.Instructions.GT(a, b)
Greater Than (commutative)
- ticktalkpython.Instructions.GTE(a, b)
Greater Than Equal (commutative)
- ticktalkpython.Instructions.LT(a, b)
Less Than (commutative)
- ticktalkpython.Instructions.LTE(a, b)
Less Than Equal (commutative)
- ticktalkpython.Instructions.MAX(a, b)
Maximum (commutative)
- ticktalkpython.Instructions.MERGE(then_exp, else_exp)
Acts as an identity node. Coupled with the Immediate firing rule. Programmer direct use is highly discouraged.
- ticktalkpython.Instructions.MIN(a, b)
Minimum (commutative)
- ticktalkpython.Instructions.MULT(a, b)
Multiplication (commutative)
- ticktalkpython.Instructions.NEG(a)
Arithmetic negation
- ticktalkpython.Instructions.NEQ(a, b)
Inequality (commutative)
- ticktalkpython.Instructions.NOT(a)
Logical 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.SET_TIMEOUT(token, TTClock=None, TTExecuteOnFullToken=True)
Modifies the start and end tick of the tine interval of the token to be end tick and Time.Infinity respectively.
- Parameters:
value_token – The token carrying the desired value for the output token.
- Returns:
A
TTToken
with time interval [x, y] as [x + delay, y + delay]- 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.
- 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 graph 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