"""Constants requiring experimental optimization."""
from wisent.core.grp_05.sub_constants.for_experiments._exp_02 import *  # noqa: F401,F403


# --- SVD / subspace ---
MIN_CONCEPT_DIM = 2
MAX_CONCEPT_DIM = 32
DEFAULT_VARIANCE_THRESHOLD = 0.80
MARGINAL_VARIANCE_THRESHOLD = 0.05
UNIVERSAL_SUBSPACE_RANK = 16

# --- Broyden solver ---
BROYDEN_DEFAULT_NUM_STEPS = 3
BROYDEN_DEFAULT_ALPHA = 1.0
BROYDEN_DEFAULT_ETA = 0.5
BROYDEN_DEFAULT_BETA = 0.0
BROYDEN_DEFAULT_ALPHA_DECAY = 1.0

# --- Common defaults ---
DEFAULT_STRENGTH = 1.0
DEFAULT_LAYER = 16
DEFAULT_LAYER_CONFIG = 12
DEFAULT_NUM_HIDDEN_LAYERS = 32
DEFAULT_SCORE = 0.0
SIMILARITY_THRESHOLD = 0.8
BLEND_DEFAULT = 0.5
DEFAULT_SCALE = 1.0

# --- TECZA method ---
TECZA_NUM_DIRECTIONS = 3
TECZA_MARGINAL_THRESHOLD = 0.05
TECZA_MAX_DIRECTIONS = 10
DEFAULT_OPTIMIZATION_STEPS = 100
TECZA_LEARNING_RATE = 0.01
TECZA_RETAIN_WEIGHT = 0.1
TECZA_INDEPENDENCE_WEIGHT = 0.05
TECZA_ABLATION_WEIGHT = 1.0
TECZA_ADDITION_WEIGHT = 1.0
TECZA_MIN_COSINE_SIM = 0.3
TECZA_MAX_COSINE_SIM = 0.95

# --- TETNO method ---
TETNO_CONDITION_THRESHOLD = 0.5
TETNO_GATE_TEMPERATURE = 0.1
TETNO_ENTROPY_FLOOR = 0.5
TETNO_ENTROPY_CEILING = 2.0
TETNO_MAX_ALPHA = 2.0
TETNO_THRESHOLD_SEARCH_STEPS = 20

# --- GROM method ---
GROM_NUM_DIRECTIONS = 5
GROM_OPTIMIZATION_STEPS = 200
GROM_LEARNING_RATE = 0.005
GROM_WARMUP_STEPS = 20
GROM_BEHAVIOR_WEIGHT = 1.0
GROM_RETAIN_WEIGHT = 0.2
GROM_SPARSE_WEIGHT = 0.05
GROM_SMOOTH_WEIGHT = 0.02
GROM_INDEPENDENCE_WEIGHT = 0.03
GROM_MAX_ALPHA = 3.0
GROM_GATE_TEMPERATURE = 0.5
GROM_MIN_COSINE_SIM = 0.2
GROM_MAX_COSINE_SIM = 0.9
GROM_LINEAR_THRESHOLD = 0.8
GROM_HIDDEN_DIM = 128
GROM_ROUTER_HIDDEN_DIM = 64
GROM_INTENSITY_HIDDEN_DIM = 32
GROM_ROUTER_TEMPERATURE = 0.5

# --- NURT method ---
NURT_NUM_DIMS = 0
NURT_TRAINING_EPOCHS = 300
NURT_LR_MIN = 0.0001
NURT_NUM_INTEGRATION_STEPS = 4
NURT_T_MAX = 1.0

# --- SZLAK method ---
SZLAK_SINKHORN_REG = 0.1
SZLAK_INFERENCE_K = 5
SZLAK_MAX_ITER = 100
SZLAK_HIGH_REG = 1.0
SZLAK_SPARSE_K = 10

# --- PRZELOM method ---
PRZELOM_EPSILON = 1.0
# --- WICHER method ---
WICHER_CONCEPT_DIM = 0
# --- OSTRZE method ---
OSTRZE_C = 1.0

# --- MLP method ---
MLP_HIDDEN_DIM = 256
MLP_NUM_LAYERS = 2
MLP_DROPOUT = 0.1
MLP_LEARNING_RATE = 0.001
DEFAULT_WEIGHT_DECAY = 0.01

# --- Optimization / evaluation ---
DEFAULT_N_TRIALS = 100
DEFAULT_NUM_EVAL_PROMPTS = 30
DEFAULT_NUM_STRENGTH_STEPS = 5
DEFAULT_CHECKPOINT_INTERVAL = 5
OPTUNA_N_TRIALS_SMALL = 20
LAYER_SWEEP_STRENGTH = 1.0

# --- Classifier ---
CLASSIFIER_TEST_SIZE = 0.2
CLASSIFIER_NUM_EPOCHS = 50
CLASSIFIER_HIDDEN_DIM = 128
CLASSIFIER_DROPOUT = 0.2
CLASSIFIER_THRESHOLD = 0.5

# --- Diagnostics / quality ---
QUALITY_THRESHOLD = 50.0
DIAG_MIN_DIVERGENCE = 0.3
DIAG_MAX_LOW_DIV_FRACTION = 0.1
DIAG_NEAR_DUPLICATE_THRESHOLD = 0.9
DIAG_NUM_COMPONENTS = 5
DIAG_OPTIMIZATION_STEPS = 50
DIAG_MAX_PAIR_COMBINATIONS = 50
EWC_PERTURBATION_SCALE = 0.01
EWC_LEARNING_RATE = 1.0
CONTINUAL_EWC_LAMBDA = 1000.0
CONTINUAL_FORGETTING_THRESHOLD = 0.9
CONTINUAL_CONVERGENCE_WINDOW = 10
CONTINUAL_REPLAY_INTERVAL = 5
DEFAULT_SPLIT_RATIO = 0.8
SAMPLES_PER_BENCHMARK = 10
DEFAULT_NUM_SAMPLES = 5

# --- Evaluator thresholds ---
NLI_MARGIN = 0.12
NLI_ENT_MIN = 0.40
EMB_DELTA_MIN = 0.04
EMB_MATCH_MIN = 0.35
TRUTHFUL_MIN_SIMILARITY = 0.3
TRUTHFUL_MIN_MARGIN = 0.05
VIDEO_TEMPORAL_DECAY = 0.9

# --- Steering analysis ---
STEERING_N_RANDOM = 20
STEERING_N_PCA = 10
CONE_THRESHOLD = 0.7
CONE_DIRECTIONS = 5
MANIFOLD_NEIGHBORS = 10
MAX_CLUSTERS = 5
MOVEMENT_THRESHOLD = 0.6
BEHAVIOR_THRESHOLD = 0.0

# --- Recommendation ---
RECOMMEND_LINEAR_PROBE_HIGH = 0.85
RECOMMEND_LINEAR_PROBE_LOW = 0.65
RECOMMEND_NONLINEARITY_GAP = 0.05
RECOMMEND_ICD_HIGH = 0.7
RECOMMEND_ICD_LOW = 0.3
RECOMMEND_STABILITY_HIGH = 0.8
RECOMMEND_STABILITY_LOW = 0.5
RECOMMEND_TOP_K = 2
RECOMMEND_N_TRIALS = 500
RECOMMEND_COLLECTOR_PER_TYPE = 2

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

# --- Transport RL ---
RL_NUM_EPISODES = 10
RL_EPSILON = 0.1
RL_BASELINE = 0.5
RL_DISCOUNT = 1.0
RL_BATCH_LIMIT = 100
# --- Weight modification ---
WM_TOLERANCE = 0.01
WM_MAX_INTERFERENCE = 0.3
# --- Misc ---
N_STABILITY_RUNS = 5
CV_FOLDS = 5
VAL_SPLIT = 0.2
BENCHMARK_WEIGHT = 0.7
PROBE_WEIGHT = 0.3
BLEU_THRESHOLD = 0.5

# --- Recommendation extended thresholds ---
RECOMMEND_MULTI_CONCEPT_SILHOUETTE = 0.3
RECOMMEND_ALIGNMENT_HIGH = 0.3
RECOMMEND_ALIGNMENT_LOW = 0.1
RECOMMEND_VARIANCE_CONCENTRATED = 0.15
RECOMMEND_EFFECTIVE_DIMS_LOW = 20.0
RECOMMEND_MULTI_DIR_GAIN_HIGH = 0.05
RECOMMEND_COHERENCE_HIGH = 0.8
RECOMMEND_COHERENCE_LOW = 0.5
RECOMMEND_ICD_TOP5_THRESHOLD = 0.4
RECOMMEND_NOT_VIABLE_SCALE = 0.5
RECOMMEND_CONFIDENCE_BASE = 0.5

# --- Vector quality thresholds ---
VQ_CONVERGENCE_CRITICAL = 0.5
VQ_CONVERGENCE_WARNING = 0.75
VQ_CV_SCORE_CRITICAL = 0.3
VQ_CV_SCORE_WARNING = 0.6
VQ_SNR_CRITICAL = 10.0
VQ_SNR_WARNING = 30.0
VQ_PCA_VARIANCE_CRITICAL = 0.05
VQ_PCA_VARIANCE_WARNING = 0.15
VQ_ALIGNMENT_STD_WARNING = 0.30
VQ_ALIGNMENT_MIN_CRITICAL = 0.2
VQ_SILHOUETTE_CRITICAL = -0.1
VQ_SILHOUETTE_WARNING = 0.05
VQ_MIN_PAIRS = 5

# --- Geometry diagnostics thresholds ---
GEO_DIAG_LINEAR_VARIANCE = 0.85
GEO_DIAG_CONE_THRESHOLD = 0.65
GEO_DIAG_CLUSTER_SILHOUETTE = 0.55
GEO_DIAG_MANIFOLD_THRESHOLD = 0.70
GEO_DIAG_SPARSE_THRESHOLD = 0.1
GEO_DIAG_BIMODAL_DIP = 0.05
GEO_DIAG_ORTHOGONAL_THRESHOLD = 0.12

# --- Linearity analysis ---
LINEARITY_MAX_PAIRS = 1000
LINEARITY_PCA_COMPONENTS = 50
LINEARITY_HIDDEN_DIM_LARGE = 64
LINEARITY_HIDDEN_DIM_SMALL = 32
LINEARITY_N_CLUSTERS = 3
LINEARITY_NONLINEAR_ERROR = 0.3
LINEARITY_N_INIT = 10
LINEARITY_N_BOOTSTRAP = 100
LINEARITY_MLP_MAX_ITER = 50
LINEARITY_MIN_GAPS = 10
LINEARITY_DEGREE = 2
LINEARITY_N_FEATURES = 50
LINEARITY_REG_C = 0.1
LINEARITY_RIDGE_ALPHA = 1.0
LINEARITY_BOOTSTRAP_ITER = 50
LINEARITY_Z_SCORE_THRESHOLD = 2.0

# --- Stability analysis ---
STABILITY_N_BOOTSTRAP = 50
STABILITY_THRESHOLD_HIGH = 0.9
STABILITY_N_SUBSAMPLES = 20
STABILITY_SUBSAMPLE_RATIO = 0.8
STABILITY_THRESHOLD_MED = 0.7
STABILITY_MIN_SAMPLES_LARGE = 100
STABILITY_MIN_SAMPLES_MED = 50
STABILITY_MIN_SAMPLES_SMALL = 30
STABILITY_N_CLUSTERS = 2

# --- Search results defaults ---
SEARCH_RESULTS_TOP_N = 10

# --- Zwiad protocol ---
ZWIAD_PRZELOM_BONUS_MAX = 1.5
ZWIAD_MIN_SILHOUETTE = 0.1

# --- Detection / config manager ---
DETECTION_THRESHOLD = 0.6
CONFIG_MAX_ALPHA = 2.0

# --- Scoring weights (ScoreWeights) ---
SCORE_WEIGHT_DEFAULT = 0.0

# --- Zwiad centroids range/weight parameters ---
ZWIAD_RANGE_SPECTRAL_MIN = 0.3
ZWIAD_RANGE_SURVIVAL_MIN = 0.5
ZWIAD_RANGE_DIM_MIN = 1
ZWIAD_RANGE_DIM_MAX = 100
ZWIAD_RANGE_CONC_MAX = 0.9
ZWIAD_RANGE_SHARP_MAX = 0.9
ZWIAD_WEIGHT_SPECTRAL = 3.0
ZWIAD_WEIGHT_SURVIVAL = 1.5
ZWIAD_WEIGHT_DIM = 1.0
ZWIAD_WEIGHT_CONC = 2.0
ZWIAD_WEIGHT_SHARP = 2.0
ZWIAD_WEIGHT_EDITABILITY = 1.5
