Skip to content

OrderedSchedule ​

Inherits: TaskSchedule < Resource

Inherited by: WanderSchedule

OrderedSchedule executes tasks in a defined sequence using clean signal-based communication. Tasks are run one after another: Task 1 → Task 2 → Task 3 → repeat (if looping).

Properties ​

ExecutionTypeexecution_typeExecutionType.ORDERED

Variables ​

intcurrent_task_index0
boolhas_completed_cyclefalse

Methods ​

voidstart_schedule()
voidon_task_completed( completed_task: BehaviorTask )
voidon_task_interrupted( interrupted_task: BehaviorTask, reason: String )
boolhas_next_task()
floatget_schedule_progress()
intget_completed_cycles()
voidreset_schedule()
voidrestart_schedule()
booljump_to_task( index: int )
BehaviorTaskget_next_task()
booladvance_to_next_task()
BehaviorTaskget_current_task()
BehaviorTaskget_current_task_by_index()
intget_current_task_index()
boolskip_current_task()
boolinsert_task_at_current( task: BehaviorTask )
boolremove_current_task()

Enumerations ​

enum ExecutionType ​

The execution strategy for this schedule

Property descriptions ​

ExecutionType execution_type = ExecutionType.ORDERED ​

Ordered: the tasks run one after the other.

Variable descriptions ​

int current_task_index = 0 ​

Current task index in the sequence

bool has_completed_cycle = false ​

Whether we've completed at least one full cycle

Method descriptions ​

void start_schedule() ​

Start this schedule - begin with first task

void on_task_completed( completed_task: BehaviorTask ) ​

Called when current task completes - advance to next task

void on_task_interrupted( interrupted_task: BehaviorTask, reason: String ) ​

Called when current task is interrupted

bool has_next_task() ​

Check if the schedule has more tasks

float get_schedule_progress() ​

Get progress through the current schedule cycle (0.0 to 1.0)

int get_completed_cycles() ​

Get total number of completed cycles

void reset_schedule() ​

Reset the schedule to the beginning

void restart_schedule() ​

Restart the schedule from the beginning

bool jump_to_task( index: int ) ​

Jump to a specific task index

BehaviorTask get_next_task() ​

Get the next task to execute based on ordered sequence

bool advance_to_next_task() ​

Advance to the next task in sequence (compatibility method)

BehaviorTask get_current_task() ​

Get the current task being executed (compatibility override)

BehaviorTask get_current_task_by_index() ​

Get the task at the current index

int get_current_task_index() ​

Get the current task index

bool skip_current_task() ​

Skip the current task and advance to next

bool insert_task_at_current( task: BehaviorTask ) ​

Insert a task at the current position (will be executed next)

bool remove_current_task() ​

Remove the current task and advance