import { Stream, StreamIO } from "../data/Stream"; import { ArrayType, BlobType, BooleanType, DictType, EastFunction, EastType, FloatType, MLFunction, Nullable, SetType, StringType, StructType, VariantType } from "../east"; import { ProcedureDescription } from '../function'; import { MLModel, MLPredictionConfiguration } from '../ml'; import type { ModulePath } from '../template/Module'; import { OptimizationAlgorithm } from './optimization'; /** @internal */ export type ResourceDescription = { name: string; type: T; input: string; description: any | null; }; /** @internal */ export type MLDescription = { name: string; output_type: T; features_type: Features; model: MLModel; input: string; modelStream: Stream; }; /** @internal */ export type MLEvaluator = (features: EastFunction, config?: Partial>) => EastFunction; /** @internal */ export declare function MLEvaluator(ml: ML): MLEvaluator; /** @internal */ export declare function createMLAST(ml: MLDescription, features: EastFunction, config?: Record): MLFunction; /** @internal */ export declare function mlEqual(ml1: MLDescription, ml2: MLDescription): boolean; /** @internal */ export type Statement = { type: "comment"; comment: string; } | { type: "let"; name: string; expr: EastFunction; schema?: any; } | { type: "assign"; name: string; expr: EastFunction; } | { type: "error"; message: EastFunction; } | { type: "warn"; message: EastFunction; } | { type: "log"; message: EastFunction; } | { type: "set"; resource: string; expr: EastFunction; } | { type: "insert"; collection: EastFunction; key: "first" | "last" | EastFunction; value?: EastFunction; if_exists: 'error' | 'warn' | 'ignore'; } | { type: "update"; collection: EastFunction; key: EastFunction; value: EastFunction; old_value: string; } | { type: "delete"; collection: EastFunction; key: "first" | "last" | EastFunction; if_not_exists: 'error' | 'warn' | 'ignore'; } | { type: "clear"; collection: EastFunction; } | { type: "execute"; process: string; values: EastFunction; } | { type: "if"; predicate: EastFunction; true_block: Statement[]; false_block: Statement[]; } | { type: "ifNull"; input: EastFunction; null_block: Statement[]; value_block: Statement[]; value: string; } | { type: "match"; variant: EastFunction; cases: Record; data: string; } | { type: "while"; label: string; predicate: EastFunction; block: Statement[]; } | { type: "for"; label: string; collection: EastFunction; key: string; value: string | null; block: Statement[]; } | { type: "continue"; label: string; } | { type: "break"; label: string; } | { type: "end"; predicate: EastFunction; }; /** @internal */ export type ProcessDescription = { name: string; values: V; type: T; description: string | null; statements: Statement[]; input: string | null; }; /** @internal */ export type SimulationConfiguration = { trajectories: null | number; in_memory: boolean; journal: boolean; queue: boolean; debug: boolean; }; /** @internal */ export type SimulationTaskDescription = { task_type: "simulation"; module: ModulePath; name: string; inputs: Record; outputs: Record; resources: Record>; processes: Record>; mls: Record; procedures: Record; results: Record; configuration: SimulationConfiguration; initial_queue: string | null; end_date: string | null; random_seed: string; }; /** @internal */ export type Optimization = { optimization_type: "set"; resource: string; transform: EastFunction; } | { optimization_type: "update"; resource: string; field: string; active: EastFunction; transform: EastFunction; }; /** @internal */ export type OptimizationConfiguration = { trajectories: null | number; max_iterations: number; min_iterations: number; rtol: number; atol: number; threads: boolean; in_memory: boolean; optimization_algorithm: OptimizationAlgorithm; }; /** @internal */ export type OptimizationTaskDescription = { task_type: "optimization"; module: ModulePath; name: string; inputs: Record; outputs: Record; resources: Record>; processes: Record>; mls: Record; procedures: Record; objective: EastFunction; optimizations: Optimization[]; configuration: OptimizationConfiguration; initial_queue: string | null; end_date: string | null; random_seed: string; }; /** @internal */ export type CustomOptimizationConfiguration = { trajectories: number; max_iterations: number; min_iterations: number; rtol: number; atol: number; in_memory: boolean; optimization_algorithm: OptimizationAlgorithm; }; /** @internal */ export type CustomOptimizationTaskDescription = { task_type: "custom_optimization"; module: ModulePath; name: string; inputs: Record; outputs: Record; results: Record; image: string | null; mountDir: string; inputFiles: { input: string; path: string; executable: boolean; toBlob: EastFunction; }[]; outputFiles: { path: string; fromBlob: EastFunction; }[]; command: string[] | null; objective: EastFunction; optimizations: Optimization[]; configuration: CustomOptimizationConfiguration; logStdOut: boolean; logStdErr: boolean; envs: Record>; simulationTrajectories: number | null; };