"""happy-simulator: A discrete-event simulation library for Python."""

__version__ = "0.1.3"

import logging

# Library best practice: silent by default
# Users must explicitly enable logging using the configure functions below
logging.getLogger("happysimulator").addHandler(logging.NullHandler())

# Core simulation types
# AI integration
from happysimulator.ai import (
    MetricDiff,
    Recommendation,
    SimulationComparison,
    SimulationResult,
    SweepResult,
    generate_recommendations,
)

# Components
from happysimulator.components import (
    AdaptivePolicy,
    ConsumerGroup,
    ConsumerGroupStats,
    Counter,
    EventLog,
    EventLogStats,
    FIFOQueue,
    FixedWindowPolicy,
    Grant,
    Inductor,
    InductorStats,
    LateEventPolicy,
    LeakyBucketPolicy,
    LIFOQueue,
    LinkStats,
    Network,
    NetworkLink,
    Partition,
    PriorityQueue,
    Queue,
    QueuedResource,
    QueueDriver,
    RandomRouter,
    RangeAssignment,
    RateAdjustmentReason,
    RateLimitedEntity,
    RateLimitedEntityStats,
    RateLimiterPolicy,
    RateSnapshot,
    Record,
    Resource,
    ResourceStats,
    RoundRobinAssignment,
    SessionWindow,
    Sink,
    SizeRetention,
    SlidingWindow,
    SlidingWindowPolicy,
    StickyAssignment,
    StreamProcessor,
    StreamProcessorStats,
    TimeRetention,
    TokenBucketPolicy,
    TumblingWindow,
    cross_region_network,
    datacenter_network,
    internet_network,
    local_network,
    lossy_network,
    mobile_3g_network,
    mobile_4g_network,
    satellite_network,
    slow_network,
)

# Advertising
from happysimulator.components.advertising import (
    AdPlatform,
    AdPlatformStats,
    Advertiser,
    AdvertiserStats,
    AudienceTier,
)

# Behavior
from happysimulator.components.behavior import (
    Agent,
    AgentState,
    AgentStats,
    BehaviorEnvironment,
    BoundedConfidenceModel,
    BoundedRationalityModel,
    Choice,
    CompositeModel,
    DecisionContext,
    DeGrootModel,
    DemographicSegment,
    EnvironmentStats,
    Memory,
    NormalTraitDistribution,
    PersonalityTraits,
    Population,
    PopulationStats,
    Relationship,
    Rule,
    RuleBasedModel,
    SocialGraph,
    SocialInfluenceModel,
    TraitSet,
    UniformTraitDistribution,
    UtilityModel,
    VoterModel,
    broadcast_stimulus,
    influence_propagation,
    policy_announcement,
    price_change,
    targeted_stimulus,
)

# Consensus & Coordination
from happysimulator.components.consensus import (
    Ballot,
    BullyStrategy,
    DistributedLock,
    FlexiblePaxosNode,
    KVStateMachine,
    LeaderElection,
    LockGrant,
    Log,
    LogEntry,
    MembershipProtocol,
    MemberState,
    MultiPaxosNode,
    PaxosNode,
    PhiAccrualDetector,
    RaftNode,
    RaftState,
    RandomizedStrategy,
    RingStrategy,
)

# CRDTs
from happysimulator.components.crdt import (
    CRDT,
    CRDTStore,
    CRDTStoreStats,
    GCounter,
    LWWRegister,
    ORSet,
    PNCounter,
)

# Deployment
from happysimulator.components.deployment import (
    AutoScaler,
    AutoScalerStats,
    CanaryDeployer,
    CanaryDeployerStats,
    CanaryStage,
    CanaryState,
    DeploymentState,
    ErrorRateEvaluator,
    LatencyEvaluator,
    MetricEvaluator,
    QueueDepthScaling,
    RollingDeployer,
    RollingDeployerStats,
    ScalingEvent,
    ScalingPolicy,
    StepScaling,
    TargetUtilization,
)

# Industrial simulation components
from happysimulator.components.industrial import (
    AppointmentScheduler,
    BalkingQueue,
    BatchProcessor,
    BreakdownScheduler,
    ConditionalRouter,
    ConveyorBelt,
    GateController,
    InspectionStation,
    InventoryBuffer,
    PerishableInventory,
    PooledCycleResource,
    PreemptibleGrant,
    PreemptibleResource,
    RenegingQueuedResource,
    Shift,
    ShiftedServer,
    ShiftSchedule,
    SplitMerge,
)

# Infrastructure Primitives
from happysimulator.components.infrastructure import (
    AIMD,
    BBR,
    HDD,
    SSD,
    ConcurrentGC,
    CPUScheduler,
    CPUSchedulerStats,
    Cubic,
    DiskIO,
    DiskIOStats,
    DiskProfile,
    DNSRecord,
    DNSResolver,
    DNSStats,
    FairShare,
    GarbageCollector,
    GCStats,
    GenerationalGC,
    NVMe,
    PageCache,
    PageCacheStats,
    PriorityPreemptive,
    StopTheWorld,
    TCPConnection,
    TCPStats,
)

# Microservice patterns
from happysimulator.components.microservice import (
    APIGateway,
    IdempotencyStore,
    OutboxRelay,
    RouteConfig,
    Saga,
    SagaState,
    SagaStep,
    Sidecar,
)

# Scheduling
from happysimulator.components.scheduling import (
    JobDefinition,
    JobScheduler,
    JobSchedulerStats,
    JobState,
    WorkerStats,
    WorkStealingPool,
    WorkStealingPoolStats,
)

# Server
from happysimulator.components.server import Server, ServerStats

# Sketching entity wrappers
from happysimulator.components.sketching import (
    QuantileEstimator,
    SketchCollector,
    TopKCollector,
)

# Storage Engine Internals
from happysimulator.components.storage import (
    BTree,
    FIFOCompaction,
    IsolationLevel,
    LeveledCompaction,
    LSMTree,
    Memtable,
    SizeTieredCompaction,
    SSTable,
    SyncEveryWrite,
    SyncOnBatch,
    SyncPeriodic,
    TransactionManager,
    WriteAheadLog,
)
from happysimulator.core import (
    BreakpointContext,
    CallbackEntity,
    Clock,
    ClockModel,
    ConditionBreakpoint,
    Entity,
    Event,
    EventCountBreakpoint,
    EventTypeBreakpoint,
    FixedSkew,
    HLCTimestamp,
    HybridLogicalClock,
    Instant,
    LamportClock,
    LinearDrift,
    MetricBreakpoint,
    NodeClock,
    NullEntity,
    SimFuture,
    Simulatable,
    Simulation,
    SimulationControl,
    SimulationState,
    TimeBreakpoint,
    VectorClock,
    all_of,
    any_of,
    simulatable,
)
from happysimulator.core.temporal import Duration

# Distributions
from happysimulator.distributions import (
    ConstantLatency,
    ExponentialLatency,
    PercentileFittedLatency,
    UniformDistribution,
    ValueDistribution,
    ZipfDistribution,
)

# Fault injection
from happysimulator.faults import FaultSchedule

# Instrumentation
from happysimulator.instrumentation import (
    BucketedData,
    Data,
    EntitySummary,
    LatencyTracker,
    Probe,
    QueueStats,
    SimulationSummary,
    ThroughputTracker,
)

# Load generation
from happysimulator.load import (
    ConstantArrivalTimeProvider,
    ConstantRateProfile,
    DistributedFieldProvider,
    EventProvider,
    LinearRampProfile,
    PoissonArrivalTimeProvider,
    Profile,
    SimpleEventProvider,
    Source,
    SpikeProfile,
)

# Logging configuration utilities
from happysimulator.logging_config import (
    configure_from_env,
    disable_logging,
    enable_console_logging,
    enable_file_logging,
    enable_json_file_logging,
    enable_json_logging,
    enable_timed_file_logging,
    set_level,
    set_module_level,
)

# Sketching algorithms
from happysimulator.sketching import (
    BloomFilter,
    CountMinSketch,
    FrequencyEstimate,
    HyperLogLog,
    KeyRange,
    MerkleTree,
    ReservoirSampler,
    TDigest,
    TopK,
)

__all__ = [
    "AIMD",
    "BBR",
    # CRDTs
    "CRDT",
    "HDD",
    "SSD",
    "APIGateway",
    "AdPlatform",
    "AdPlatformStats",
    "AdaptivePolicy",
    "Advertiser",
    "AdvertiserStats",
    "Agent",
    "AgentState",
    "AgentStats",
    "AppointmentScheduler",
    # Advertising
    "AudienceTier",
    # Deployment
    "AutoScaler",
    "AutoScalerStats",
    "BTree",
    # Industrial simulation components
    "BalkingQueue",
    "Ballot",
    "BatchProcessor",
    "BehaviorEnvironment",
    "BloomFilter",
    "BoundedConfidenceModel",
    "BoundedRationalityModel",
    "BreakdownScheduler",
    "BreakpointContext",
    # Instrumentation
    "BucketedData",
    "BullyStrategy",
    "CPUScheduler",
    "CPUSchedulerStats",
    "CRDTStore",
    "CRDTStoreStats",
    "CallbackEntity",
    "CanaryDeployer",
    "CanaryDeployerStats",
    "CanaryStage",
    "CanaryState",
    "Choice",
    "Clock",
    # Node clocks
    "ClockModel",
    "CompositeModel",
    "ConcurrentGC",
    "ConditionBreakpoint",
    "ConditionalRouter",
    "ConstantArrivalTimeProvider",
    # Distributions
    "ConstantLatency",
    "ConstantRateProfile",
    "ConsumerGroup",
    "ConsumerGroupStats",
    "ConveyorBelt",
    "CountMinSketch",
    # Components
    "Counter",
    "Cubic",
    "DNSRecord",
    "DNSResolver",
    "DNSStats",
    "Data",
    "DeGrootModel",
    "DecisionContext",
    "DemographicSegment",
    "DeploymentState",
    # Infrastructure Primitives
    "DiskIO",
    "DiskIOStats",
    "DiskProfile",
    # Load providers
    "DistributedFieldProvider",
    "DistributedLock",
    "Duration",
    "Entity",
    "EntitySummary",
    "EnvironmentStats",
    "ErrorRateEvaluator",
    "Event",
    "EventCountBreakpoint",
    # Streaming
    "EventLog",
    "EventLogStats",
    "EventProvider",
    "EventTypeBreakpoint",
    "ExponentialLatency",
    "FIFOCompaction",
    "FIFOQueue",
    "FairShare",
    # Fault injection
    "FaultSchedule",
    "FixedSkew",
    "FixedWindowPolicy",
    "FlexiblePaxosNode",
    "FrequencyEstimate",
    "GCStats",
    "GCounter",
    "GarbageCollector",
    "GateController",
    "GenerationalGC",
    "Grant",
    "HLCTimestamp",
    "HybridLogicalClock",
    "HyperLogLog",
    # Microservice patterns
    "IdempotencyStore",
    "Inductor",
    "InductorStats",
    "InspectionStation",
    "Instant",
    "InventoryBuffer",
    "IsolationLevel",
    # Scheduling
    "JobDefinition",
    "JobScheduler",
    "JobSchedulerStats",
    "JobState",
    "KVStateMachine",
    "KeyRange",
    "LIFOQueue",
    "LSMTree",
    "LWWRegister",
    # Logical clocks
    "LamportClock",
    "LateEventPolicy",
    "LatencyEvaluator",
    "LatencyTracker",
    "LeaderElection",
    "LeakyBucketPolicy",
    "LeveledCompaction",
    "LinearDrift",
    "LinearRampProfile",
    "LinkStats",
    "LockGrant",
    # Consensus & Coordination
    "Log",
    "LogEntry",
    "MemberState",
    "MembershipProtocol",
    "Memory",
    "Memtable",
    "MerkleTree",
    "MetricBreakpoint",
    "MetricDiff",
    "MetricEvaluator",
    "MultiPaxosNode",
    "NVMe",
    # Network
    "Network",
    "NetworkLink",
    "NodeClock",
    "NormalTraitDistribution",
    "NullEntity",
    "ORSet",
    "OutboxRelay",
    "PNCounter",
    "PageCache",
    "PageCacheStats",
    "Partition",
    "PaxosNode",
    "PercentileFittedLatency",
    "PerishableInventory",
    "PersonalityTraits",
    "PhiAccrualDetector",
    "PoissonArrivalTimeProvider",
    "PooledCycleResource",
    "Population",
    "PopulationStats",
    "PreemptibleGrant",
    "PreemptibleResource",
    "PriorityPreemptive",
    "PriorityQueue",
    "Probe",
    "Profile",
    "QuantileEstimator",
    "Queue",
    "QueueDepthScaling",
    "QueueDriver",
    "QueueStats",
    "QueuedResource",
    "RaftNode",
    "RaftState",
    "RandomRouter",
    "RandomizedStrategy",
    "RangeAssignment",
    "RateAdjustmentReason",
    "RateLimitedEntity",
    "RateLimitedEntityStats",
    # Rate limiters
    "RateLimiterPolicy",
    "RateSnapshot",
    "Recommendation",
    "Record",
    "Relationship",
    "RenegingQueuedResource",
    "ReservoirSampler",
    # Shared resources
    "Resource",
    "ResourceStats",
    "RingStrategy",
    "RollingDeployer",
    "RollingDeployerStats",
    "RoundRobinAssignment",
    "RouteConfig",
    "Rule",
    "RuleBasedModel",
    # Storage Engine Internals
    "SSTable",
    "Saga",
    "SagaState",
    "SagaStep",
    "ScalingEvent",
    "ScalingPolicy",
    # Server
    "Server",
    "ServerStats",
    "SessionWindow",
    "Shift",
    "ShiftSchedule",
    "ShiftedServer",
    "Sidecar",
    # SimFuture
    "SimFuture",
    # Load
    "SimpleEventProvider",
    "Simulatable",
    # Core
    "Simulation",
    "SimulationComparison",
    # Simulation control
    "SimulationControl",
    # AI integration
    "SimulationResult",
    "SimulationState",
    "SimulationSummary",
    "Sink",
    "SizeRetention",
    "SizeTieredCompaction",
    # Sketching entity wrappers
    "SketchCollector",
    "SlidingWindow",
    "SlidingWindowPolicy",
    "SocialGraph",
    "SocialInfluenceModel",
    "Source",
    "SpikeProfile",
    "SplitMerge",
    "StepScaling",
    "StickyAssignment",
    "StopTheWorld",
    "StreamProcessor",
    "StreamProcessorStats",
    "SweepResult",
    "SyncEveryWrite",
    "SyncOnBatch",
    "SyncPeriodic",
    "TCPConnection",
    "TCPStats",
    "TDigest",
    "TargetUtilization",
    "ThroughputTracker",
    "TimeBreakpoint",
    "TimeRetention",
    "TokenBucketPolicy",
    # Sketching algorithms
    "TopK",
    "TopKCollector",
    # Behavior
    "TraitSet",
    "TransactionManager",
    "TumblingWindow",
    "UniformDistribution",
    "UniformTraitDistribution",
    "UtilityModel",
    "ValueDistribution",
    "VectorClock",
    "VoterModel",
    "WorkStealingPool",
    "WorkStealingPoolStats",
    "WorkerStats",
    "WriteAheadLog",
    "ZipfDistribution",
    # Package metadata
    "__version__",
    "all_of",
    "any_of",
    "broadcast_stimulus",
    # Logging configuration
    "configure_from_env",
    "cross_region_network",
    "datacenter_network",
    "disable_logging",
    "enable_console_logging",
    "enable_file_logging",
    "enable_json_file_logging",
    "enable_json_logging",
    "enable_timed_file_logging",
    "generate_recommendations",
    "influence_propagation",
    "internet_network",
    "local_network",
    "lossy_network",
    "mobile_3g_network",
    "mobile_4g_network",
    "policy_announcement",
    "price_change",
    "satellite_network",
    "set_level",
    "set_module_level",
    "simulatable",
    "slow_network",
    "targeted_stimulus",
]
