【问题标题】:How to run jess file (.clp file) from windows CMD/ .bat file?如何从 Windows CMD/.bat 文件运行 jess 文件(.clp 文件)?
【发布时间】:2021-01-09 13:14:17
【问题描述】:

如何在 windows cmd / .bat 文件中运行 .clp 文件(jess)?我当前的文件如下所示:

(deftemplate Tree (slot current_node)(slot node_childrens))

(assert (Tree (current_node A)(node_childrens B,C,D)))
(assert (Tree (current_node B)(node_childrens E)))
(assert (Tree (current_node C)(node_childrens F,G)))

(defrule display_data
    
    (Tree (current_node ?cn))
    =>
    (printout t ?cn " ")
)

(run)

运行后控制台输出如下:

C B A

如何从 windows cmd 运行该文件并在那里查看输出?例如,如果我有一个名为“myfile.py”的 python 文件,我可以使用以下命令运行它:

python myfile.py

如何在 windows cmd / .bat 文件中运行 jess 文件?

【问题讨论】:

    标签: java clips jess


    【解决方案1】:

    要在批处理文件中运行python myfile.py,您可以这样做:

    myscript.bat:

    path/to/python/executable path/to/python/file.py
    pause
    

    但是,如果您安装了clips 命令行工具,您可以这样做:

    脚本.bat

    (load myfile.clp)
    (reset)
    (run)
    

    然后使用clips -f2 script.bat 调用它,它也可以从批处理文件中调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-06
      • 1970-01-01
      • 2020-03-09
      • 1970-01-01
      • 2017-11-28
      • 2018-04-27
      • 2012-10-08
      • 1970-01-01
      相关资源
      最近更新 更多