Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Iamhankai Forest of Thought Init Numbers

From Leeroopedia
Revision as of 13:07, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Iamhankai_Forest_of_Thought_Init_Numbers.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Ensemble_Methods, Data_Augmentation
Last Updated 2026-02-14 03:00 GMT

Overview

Concrete tool for generating shuffled input variations for ensemble tree search provided by the Forest-of-Thought repository.

Description

The init_numbers function creates count shuffled variations of a space-separated number string. The first variation preserves the original order, and subsequent variations are random shuffles. This provides input diversity for each tree in the forest.

Usage

Called at the start of forest_solve() to create distinct inputs for each tree in the Game24 forest.

Code Reference

Source Location

Signature

def init_numbers(x, count):
    """
    Generate shuffled variations of input numbers.

    Args:
        x (str): Space-separated numbers (e.g., "1 2 3 4").
        count (int): Number of variations to generate.

    Returns:
        list[str]: List of space-separated number strings,
                   first is original order, rest are shuffled.
    """

Import

from methods.bfs import init_numbers

I/O Contract

Inputs

Name Type Required Description
x str Yes Space-separated numbers (e.g., "1 2 3 4")
count int Yes Number of shuffled variations (equals tree_num)

Outputs

Name Type Description
number_list list[str] List of count space-separated number strings

Usage Examples

from methods.bfs import init_numbers

variations = init_numbers("1 2 3 4", count=4)
# Possible output:
# ["1 2 3 4", "3 1 4 2", "4 2 1 3", "2 3 4 1"]

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment