All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.timefold.jpyinterpreter.PythonInterpreter Maven / Gradle / Ivy

Go to download

Timefold solves planning problems. This lightweight, embeddable planning engine implements powerful and scalable algorithms to optimize business resource scheduling and planning. This module contains the Python interpreter.

The newest version!
package ai.timefold.jpyinterpreter;

import java.util.List;
import java.util.Map;

import ai.timefold.jpyinterpreter.types.PythonString;
import ai.timefold.jpyinterpreter.types.errors.PythonTraceback;
import ai.timefold.jpyinterpreter.types.numeric.PythonInteger;
import ai.timefold.jpyinterpreter.types.wrappers.OpaquePythonReference;

public interface PythonInterpreter {
    PythonInterpreter DEFAULT = new CPythonBackedPythonInterpreter();

    boolean hasValidPythonReference(PythonLikeObject instance);

    void setPythonReference(PythonLikeObject instance, OpaquePythonReference reference);

    PythonLikeObject getGlobal(Map globalsMap, String name);

    void setGlobal(Map globalsMap, String name, PythonLikeObject value);

    void deleteGlobal(Map globalsMap, String name);

    PythonLikeObject importModule(PythonInteger level, List fromList, Map globalsMap,
            Map localsMap, String moduleName);

    /**
     * Writes output without a trailing newline to standard output
     *
     * @param output the text to write
     */
    void write(String output);

    /**
     * Reads a line from standard input
     *
     * @return A line read from standard input
     */
    String readLine();

    PythonTraceback getTraceback();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy