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:Open compass VLMEvalKit VGRPBench TreesAndTents

From Leeroopedia
Field Value
source VLMEvalKit
domain Vision, Evaluation, Puzzle_Solving

Overview

Implements constraint checking and puzzle factory for the Trees and Tents camping puzzle in VGRPBench.

Description

This module defines constraint validators and a puzzle factory for the Trees and Tents puzzle type, where tents must be placed adjacent to trees with row and column count constraints. The ConstraintRowTents and ConstraintColTents classes enforce per-line tent count clues. The ConstraintTentTree class validates that each tent has exactly one adjacent tree and each tree has at least one adjacent tent or potential tent position. The ConstraintAdjacentTents class prevents tents from being adjacent including diagonally, and ConstraintTentTreeCount ensures the total tent count can match the tree count.

Usage

Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.

Code Reference

  • Source: vlmeval/dataset/utils/vgrpbench/puzzles/treesandtents.py, Lines: L1-179
  • Import: from vlmeval.dataset.utils.vgrpbench.puzzles.treesandtents import TreesAndTentsPuzzleFactory

Key Classes:

class ConstraintRowTents(Constraint): ...
class ConstraintColTents(Constraint): ...
class ConstraintTentTree(Constraint): ...
class ConstraintAdjacentTents(Constraint): ...
class ConstraintTentTreeCount(Constraint): ...
class TreesAndTentsPuzzleFactory(PuzzleFactory): ...

I/O Contract

Direction Description
Inputs Puzzle grid state with board containing 'tt' (tent), 'tr' (tree), 'e' (empty), and clues with row_clues and col_clues
Outputs Boolean validation result or constraint violations

Usage Examples

# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.treesandtents import TreesAndTentsPuzzleFactory
factory = TreesAndTentsPuzzleFactory(size=6)
result = factory.check(game_state)

Related Pages

Page Connections

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