You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dataclassclassEnergyCoefficients:
"""Energy coefficients for different computational operations."""# Core coefficientsflops_pj: float=1.0# Energy per FLOP (picojoules)sram_pj_per_byte: float=0.1# SRAM access energy per bytedram_pj_per_byte: float=20.0# DRAM access energy per bytespike_aj: float=1.0# Neuromorphic spike energy (attojoules)# Physical coefficientsbody_per_joint_w: float=2.0# Actuation power per joint (watts)body_sensor_w_per_channel: float=0.005# Sensor power per channel (watts)baseline_w: float=0.5# Baseline system power (watts)
defcalculate_contact_complexity(
joint_count: int,
contact_points: int,
friction_coefficient: float=0.3,
surface_normal_force: float=10.0
) ->float:
"""Calculate complexity of contact dynamics for legged locomotion. Args: joint_count: Number of joints in the system contact_points: Number of contact points with the environment friction_coefficient: Coefficient of friction surface_normal_force: Normal force per contact point (N) Returns: Contact complexity metric Example: >>> complexity = calculate_contact_complexity( ... joint_count=6, contact_points=4, friction_coefficient=0.3 ... ) >>> print(f"Contact complexity: {complexity:.2f}") """
Brain Workload Functions
defcalculate_sparse_neural_complexity(
neurons: int,
connections: int,
sparsity: float=0.1,
temporal_horizon: int=10
) ->Dict[str, float]:
"""Calculate complexity of sparse neural network processing. Args: neurons: Number of neurons in the network connections: Number of synaptic connections sparsity: Connection sparsity (0.0 to 1.0) temporal_horizon: Temporal processing horizon Returns: Dictionary containing complexity metrics: - information_capacity: Information processing capacity - computational_density: Operations per neuron - temporal_complexity: Time-dependent processing complexity Example: >>> complexity = calculate_sparse_neural_complexity( ... neurons=1000, connections=10000, sparsity=0.1 ... ) >>> print(f"Capacity: {complexity['information_capacity']:.2e}") """
Mind Workload Functions
defcalculate_active_inference_complexity(
state_space_size: int,
observation_space_size: int,
planning_horizon: int,
branching_factor: int=3
) ->Dict[str, float]:
"""Calculate complexity of active inference planning. Args: state_space_size: Size of the state space observation_space_size: Size of the observation space planning_horizon: Temporal planning horizon branching_factor: Decision branching factor Returns: Dictionary containing complexity metrics: - state_uncertainty: Uncertainty in state estimation - planning_complexity: Computational complexity of planning - information_efficiency: Information processing efficiency Example: >>> complexity = calculate_active_inference_complexity( ... state_space_size=100, observation_space_size=50, ... planning_horizon=5, branching_factor=3 ... ) >>> print(f"Planning complexity: {complexity['planning_complexity']:.2e}") """
π¨ Figure Generation API
Figures Module (antstack_core.figures)
Plotting Utilities (plots.py)
Scatter Plot Function
defcreate_scatter_plot(
x_data: np.ndarray,
y_data: np.ndarray,
x_label: str="X",
y_label: str="Y",
title: str="Scatter Plot",
color: str="blue",
alpha: float=0.7,
figsize: Tuple[float, float] = (8, 6)
) ->plt.Figure:
"""Create publication-quality scatter plot. Args: x_data: X-axis data y_data: Y-axis data x_label: X-axis label y_label: Y-axis label title: Plot title color: Point color alpha: Point transparency figsize: Figure size (width, height) Returns: Matplotlib Figure object Example: >>> x = np.random.normal(0, 1, 100) >>> y = 2*x + np.random.normal(0, 0.5, 100) >>> fig = create_scatter_plot(x, y, "Input", "Output", "Linear Relationship") >>> plt.savefig("scatter_plot.png") """
classEnhancedEnergyEstimator:
"""Enhanced energy estimator with comprehensive analysis capabilities. Provides detailed energy estimation, scaling analysis, and theoretical limit comparisons for all Ant Stack modules. """def__init__(self, coefficients: EnergyCoefficients):
"""Initialize estimator with energy coefficients. Args: coefficients: EnergyCoefficients instance with device parameters """defanalyze_body_scaling(
self,
j_values: List[int],
base_params: Dict[str, Any]
) ->ModuleScalingData:
"""Analyze AntBody energy scaling across joint counts. Args: j_values: List of joint counts to analyze base_params: Base parameters for body analysis Returns: ModuleScalingData with scaling analysis results """defanalyze_brain_scaling(
self,
c_values: List[int],
base_params: Dict[str, Any]
) ->ModuleScalingData:
"""Analyze AntBrain energy scaling across channel counts. Args: c_values: List of channel counts to analyze base_params: Base parameters for brain analysis Returns: ModuleScalingData with scaling analysis results """defanalyze_mind_scaling(
self,
h_values: List[int],
base_params: Dict[str, Any]
) ->ModuleScalingData:
"""Analyze AntMind energy scaling across planning horizons. Args: h_values: List of planning horizons to analyze base_params: Base parameters for mind analysis Returns: ModuleScalingData with scaling analysis results """
Veridical Reporting (veridical_reporting.py)
Veridical Reporter Class
classVeridicalReporter:
"""Comprehensive veridical reporting system. Provides principled, evidence-based scientific reporting with uncertainty quantification and reproducibility tracking. """defgenerate_empirical_evidence(
self,
measurements: Dict[str, Any],
statistical_tests: Dict[str, Any],
confidence_level: float=0.95
) ->EmpiricalEvidence:
"""Generate comprehensive empirical evidence report. Args: measurements: Raw measurement data statistical_tests: Statistical analysis results confidence_level: Confidence level for uncertainty quantification Returns: EmpiricalEvidence object with validated findings """defcreate_case_study(
self,
system_description: str,
experimental_setup: Dict[str, Any],
results: Dict[str, Any],
implications: List[str]
) ->CaseStudy:
"""Create detailed case study with scientific rigor. Args: system_description: Description of the system under study experimental_setup: Experimental methodology and parameters results: Experimental results and findings implications: Scientific and practical implications Returns: CaseStudy object with comprehensive analysis """