"""Agent, marketplace, classifier, and task selection constants."""
from wisent.core.infrastructure.constant_definitions.for_experiments.by_domain.analysis.infra._data_infra import *  # noqa: F401,F403

# --- Classifier core ---
CLASSIFIER_TEST_SIZE = 0.2
CLASSIFIER_NUM_EPOCHS = 50
CLASSIFIER_HIDDEN_DIM = 128
CLASSIFIER_DROPOUT = 0.2
CLASSIFIER_THRESHOLD = 0.5
CLASSIFIER_EARLY_STOPPING_PATIENCE = 10
CLASSIFIER_TRAINING_SAMPLES = 25
CLASSIFIER_LAYER_RANGE_END = 23

# --- Classifier scoring weights ---
CLASSIFIER_SCORE_DIRECT_MATCH = 5.0
CLASSIFIER_SCORE_EXACT_CONCEPT = 4.0
CLASSIFIER_SCORE_PARTIAL_CONCEPT = 2.0
CLASSIFIER_SCORE_SEMANTIC_SIMILAR = 1.5
CLASSIFIER_SCORE_TOKEN_EXACT = 3.0
CLASSIFIER_SCORE_TOKEN_SUBSTRING = 1.0
CLASSIFIER_SCORE_TOKEN_SEMANTIC = 0.5
CLASSIFIER_SIMILARITY_CHAR_THRESHOLD = 0.6
CLASSIFIER_SIMILARITY_AFFIX_THRESHOLD = 0.4
CLASSIFIER_SIMILARITY_AFFIX_MIN_LEN = 3

# --- Classifier name quality ---
CLASSIFIER_NAME_LENGTH_MIN = 8
CLASSIFIER_NAME_LENGTH_MAX = 25
CLASSIFIER_QUALITY_GOOD_LENGTH = 2.0
CLASSIFIER_QUALITY_SHORT_NAME = 0.5
CLASSIFIER_QUALITY_LONG_NAME = 1.0
CLASSIFIER_PARTS_OPTIMAL_MIN = 2
CLASSIFIER_PARTS_OPTIMAL_MAX = 3
CLASSIFIER_QUALITY_OPTIMAL_PARTS = 2.0
CLASSIFIER_QUALITY_SINGLE_PART = 1.5
CLASSIFIER_QUALITY_MANY_PARTS = 0.5
CLASSIFIER_PENALTY_EXPERIMENTAL = 1.0
CLASSIFIER_BONUS_DOMAIN_DIVERSITY = 0.5

# --- Classifier benchmark ---
CLASSIFIER_BENCHMARK_SAMPLES = 50
SELECT_MAX_CLASSIFIERS = 10
TASK_RELEVANCE_MAX_RESULTS = 20
TASK_SELECTOR_MAX_TASKS = 10

# --- Select classifiers scoring ---
SELECT_F1_WEIGHT = 0.6
SELECT_ACCURACY_WEIGHT = 0.4

# --- Classifier bonus ---
CLASSIFIER_BONUS_MAX = 0.2
CLASSIFIER_BONUS_SAMPLE_DENOM = 1000
CLASSIFIER_RECENCY_BONUS = 0.1
CLASSIFIER_RECENCY_DAYS = 30

# --- Classifier thresholds ---
CLASSIFIER_MIN_TARGET_SCORE = 0.7
CLASSIFIER_MIN_PERFORMANCE_SCORE = 0.1

# --- Classifier cache scoring ---
CACHE_WEIGHT_MODEL_NAME = 0.4
CACHE_WEIGHT_TASK_NAME = 0.3
CACHE_WEIGHT_MODEL_TYPE = 0.2
CACHE_WEIGHT_LAYER_PROXIMITY = 0.1
LAYER_CACHE_DECAY_DENOMINATOR = 10.0
LAYER_CACHE_MIN_SCORE = 0.1
CLASSIFIER_CACHE_TOP_K = 5

# --- Classifier selection ---
DEFAULT_MAX_CLASSIFIERS_SELECT = 5
HASH_SAMPLE_SIZE = 100
HASH_DIGEST_PREFIX = 16
DEVICE_HASH_PREFIX = 12

# --- Agent defaults ---
AGENT_DEFAULT_SAMPLES = 25
AGENT_STEERING_THRESHOLD = 0.6
AGENT_QUALITY_THRESHOLD = 0.3
AGENT_DEFAULT_TIME_BUDGET = 5.0
AGENT_DEFAULT_TIME_BUDGET_INIT = 10.0
AGENT_DEMO_TIME_BUDGET = 2.0
AGENT_MAX_PARALLEL_WORKERS = 4
AGENT_DEFAULT_STEERING_STRENGTH = 1.0

# --- Agent generation ---
AGENT_STEERING_INITIAL_STRENGTH = 0.5
AGENT_STEERING_INCREMENT = 0.2
AGENT_STEERING_MAX_STRENGTH = 1.5
AGENT_STEERING_INITIAL_MIN = 0.1
AGENT_STEERING_INITIAL_MAX = 2.0
AGENT_STEERING_INCREMENT_MIN = 0.1
AGENT_STEERING_INCREMENT_MAX = 0.5
AGENT_STEERING_MAX_MIN = 0.5
AGENT_STEERING_MAX_MAX = 3.0
AGENT_QUALITY_STORAGE_THRESHOLD = 0.7

# --- Agent decision pipeline ---
AGENT_DECISION_NUM_SAMPLES = 50
AGENT_DECISION_QUALITY_THRESHOLD = 0.3
AGENT_DECISION_TIME_BUDGET = 10.0
AGENT_RESOURCE_BUDGET_MINUTES = 5.0
AGENT_QUALITY_HIGH_THRESHOLD = 0.7
AGENT_CONFIDENCE_HIGH_THRESHOLD = 0.8
AGENT_MAX_RESPONSE_ATTEMPTS = 3
QUALITY_CONTROL_MAX_ATTEMPTS = 5

# --- Agent improvement detection ---
AGENT_IMPROVEMENT_THRESHOLD = 0.05
AGENT_PENALTY_MULTIPLIER = 0.7

# --- Agent synthetic pair generation ---
AGENT_SYNTH_MIN_PAIRS = 5
AGENT_SYNTH_TIME_MULTIPLIER = 3
AGENT_SYNTH_PAIRS_PER_ISSUE = 5
AGENT_BENCH_MIN_PAIRS_TRAINING = 3
AGENT_CLASSIFIER_NUM_PAIRS = 15

# --- Agent budget ---
BUDGET_EMA_ALPHA = 0.3
BUDGET_DEFAULT_QUANTITY = 100
BUDGET_RECENCY_WINDOW_DAYS = 90

# --- Task relevance ---
TASK_FUZZY_MATCH_THRESHOLD = 0.6
TASK_MIN_RELEVANCE_SCORE = 0.1
TASK_SELECTOR_QUALITY_THRESHOLD = 1.5
TASK_QUALITY_SCORE_MAX = 5.0

# --- Marketplace quality scoring ---
MARKETPLACE_F1_WEIGHT = 0.5
MARKETPLACE_ACCURACY_WEIGHT = 0.2
MARKETPLACE_DATA_QUALITY_WEIGHT = 0.2
MARKETPLACE_RECENCY_WEIGHT = 0.1
MARKETPLACE_DATA_QUALITY_DENOM = 1000
MARKETPLACE_QUALITY_MAX = 0.80
MARKETPLACE_QUALITY_BASE = 0.60
MARKETPLACE_QUALITY_INCREMENT = 0.05
MARKETPLACE_QUALITY_DEFAULT = 0.55
MARKETPLACE_MIN_QUALITY_DEFAULT = 0.0

# --- Marketplace timing ---
MARKETPLACE_BASE_TRAINING_TIME = 8.0
MARKETPLACE_PER_BENCHMARK_TIME = 2.0
MARKETPLACE_SYNTHETIC_TRAINING_TIME = 6.0
MARKETPLACE_SYNTHETIC_SAMPLES = 50
MARKETPLACE_DEFAULT_OPTIMAL_LAYER = 14
MARKETPLACE_MAX_TASKS_TO_SEARCH = 1000
MARKETPLACE_MAX_RELEVANT_BENCHMARKS = 30
MARKETPLACE_MAX_RELEVANT_TO_RETURN = 15
MARKETPLACE_MAX_SIMILARITY_SCORE = 10.0

# --- Marketplace layer/speed ---
MARKETPLACE_LAYER_MIN = 8
MARKETPLACE_LAYER_MAX = 20
MARKETPLACE_CONFIDENCE_WITH_BENCHMARKS = 0.8
MARKETPLACE_CONFIDENCE_WITHOUT_BENCHMARKS = 0.6
MARKETPLACE_CUDA_SPEED_MULTIPLIER = 0.3
MARKETPLACE_MPS_SPEED_MULTIPLIER = 0.5

# --- Marketplace sample estimation ---
MARKETPLACE_MAX_SAMPLES_NEEDED = 500
MARKETPLACE_BASE_SAMPLES_NEEDED = 100
MARKETPLACE_PER_BENCHMARK_SAMPLES = 30

# --- Synthetic system costs ---
AGENT_SYNTH_TRAIT_DISCOVERY_COST_S = 10.0
AGENT_SYNTH_DATA_GEN_COST_PER_PAIR_S = 30.0
AGENT_SYNTH_CLASSIFIER_TRAINING_COST_S = 180.0
AGENT_SYNTH_PAIRS_PER_TRAIT = 12
AGENT_SYNTH_DEFAULT_PAIRS = 15

# --- Device benchmark defaults ---
AGENT_BENCH_EVAL_DEFAULT_SECONDS = 60.0
AGENT_CLASSIFIER_TRAINING_DEFAULT_SECONDS = 600.0

# --- Personalization / welfare ---
PERSONALIZATION_N_TRIALS = 20
WELFARE_LIMIT = 50
