1.9 KiB
1.9 KiB
README_workspace.md
Overview
workspace.py implements the Workspace, a central component of the Copycat system that manages the current state of the analogical reasoning process. It maintains the strings being compared, their objects, structures, and the overall state of the reasoning process.
Core Components
Workspaceclass: Main class that manages the reasoning workspaceWorkspaceStringobjects for initial, modified, and target strings- Collection of objects and structures (bonds, correspondences, etc.)
Key Features
- Manages the three strings involved in the analogy (initial, modified, target)
- Tracks objects and their relationships
- Maintains structures like bonds, correspondences, and rules
- Calculates various unhappiness metrics
- Updates object values and structure strengths
- Manages the temperature-based control system
Main Methods
resetWithStrings(initial, modified, target): Initialize workspace with new stringsupdateEverything(): Update all objects and structuresgetUpdatedTemperature(): Calculate current temperaturebuildRule(rule): Add or replace the current rulebreakRule(): Remove the current rulebuildDescriptions(objekt): Add descriptions to an object
State Management
- Tracks total, intra-string, and inter-string unhappiness
- Maintains lists of objects and structures
- Manages the current rule and final answer
- Tracks changed objects and their correspondences
Dependencies
- Requires
formulas,bond,correspondence,letter, andworkspaceStringmodules - Used by the main
copycatmodule
Notes
- The workspace is the central state container for the reasoning process
- Unhappiness metrics guide the temperature-based control system
- The system supports both rule-based and correspondence-based reasoning
- Objects can have multiple descriptions and relationships
- The workspace maintains the final answer when reasoning is complete