← 返回基因目录

evolve-life-sparse

Native evolve.life

Conway's Game of Life simulator using sparse set representation. Only tracks live cells and their neighbors, skipping empty regions entirely. Excels on large grids with low population density.

README

暂无文档。

基因作者可在发布时添加 README。

表现型

输入

属性类型 描述
grid array Custom initial grid (2D array of 0s and 1s). Ignored if preset is set.
rule string = B3/S23 Life-like rule in B/S notation (default: B3/S23 for Conway's Life)
seed number Random seed for 'random' preset (deterministic output)
width number = 64 Grid width in cells
height number = 64 Grid height in cells
preset glider | pulsar | blinker | beacon | r-pentomino | random Initial pattern preset. Overrides grid if provided.
generations number = 100 Number of generations to simulate

输出

属性类型 必填 描述
extinction boolean Whether all cells died before final generation
final_grid array Grid state after all generations
alive_count number Number of live cells in final grid
stabilized_at number Generation at which the grid stabilized (-1 if not stabilized)
ascii_snapshot string ASCII art of the final grid state (max 80x40)
cells_processed number Total cell evaluations (width * height * generations_computed)
peak_population number Maximum live cells observed across all generations
generations_computed number Actual number of generations computed (may be less if stabilized/extinct)
原始 JSON Schema

inputSchema

{
  "type": "object",
  "required": [],
  "properties": {
    "grid": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "enum": [
            0,
            1
          ],
          "type": "number"
        }
      },
      "description": "Custom initial grid (2D array of 0s and 1s). Ignored if preset is set."
    },
    "rule": {
      "type": "string",
      "default": "B3/S23",
      "description": "Life-like rule in B/S notation (default: B3/S23 for Conway's Life)"
    },
    "seed": {
      "type": "number",
      "description": "Random seed for 'random' preset (deterministic output)"
    },
    "width": {
      "type": "number",
      "default": 64,
      "maximum": 512,
      "minimum": 4,
      "description": "Grid width in cells"
    },
    "height": {
      "type": "number",
      "default": 64,
      "maximum": 512,
      "minimum": 4,
      "description": "Grid height in cells"
    },
    "preset": {
      "enum": [
        "glider",
        "pulsar",
        "blinker",
        "beacon",
        "r-pentomino",
        "random"
      ],
      "type": "string",
      "description": "Initial pattern preset. Overrides grid if provided."
    },
    "generations": {
      "type": "number",
      "default": 100,
      "maximum": 10000,
      "minimum": 1,
      "description": "Number of generations to simulate"
    }
  }
}

outputSchema

{
  "type": "object",
  "required": [
    "final_grid",
    "alive_count",
    "peak_population",
    "stabilized_at",
    "extinction",
    "generations_computed",
    "cells_processed"
  ],
  "properties": {
    "extinction": {
      "type": "boolean",
      "description": "Whether all cells died before final generation"
    },
    "final_grid": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "enum": [
            0,
            1
          ],
          "type": "number"
        }
      },
      "description": "Grid state after all generations"
    },
    "alive_count": {
      "type": "number",
      "description": "Number of live cells in final grid"
    },
    "stabilized_at": {
      "type": "number",
      "description": "Generation at which the grid stabilized (-1 if not stabilized)"
    },
    "ascii_snapshot": {
      "type": "string",
      "description": "ASCII art of the final grid state (max 80x40)"
    },
    "cells_processed": {
      "type": "number",
      "description": "Total cell evaluations (width * height * generations_computed)"
    },
    "peak_population": {
      "type": "number",
      "description": "Maximum live cells observed across all generations"
    },
    "generations_computed": {
      "type": "number",
      "description": "Actual number of generations computed (may be less if stabilized/extinct)"
    }
  }
}

竞技场历史

日期 适应度 安全分 调用数
3月17日 1.0000 1.00 1