我在Mac和Linux上使用parsecs、直径和温度单位,做关于未知区域行星问题的家庭作业或学校作业。我把模糊变量应用到行星的名称和单位上。
我添加了(import nrc.fuzzy.*)

;Distância do Coruscant
(defglobal ?*gVarDistanciaDeCoruscant* = (new nrc.fuzzy.FuzzyVariable "distanciaDeCoruscant" 0.0 30000.0 "parsecs"))

;Temperatura dos Planetas
(defglobal ?*gVarTemperatura* = (new nrc.fuzzy.FuzzyVariable "temperatura" 0 8000 "K"))

;Planetas Vizinhos
(defglobal ?*gVarPlanetasVizinhos* = (new nrc.fuzzy.FuzzyVariable "distanciaPlanetasVizinhos" 0.0 400000.0 "d"))

;Raio em termos de unidades coruscantenses
(defglobal ?*gVarTamanho* = (new nrc.fuzzy.FuzzyVariable "tamanho" 0 500 "EU"))

;Quando o planeta foi descoberto
(defglobal ?*gVarDescobertaTempo* = (new nrc.fuzzy.FuzzyVariable "descoberta" 50000BBY 400ABY))

(call nrc.fuzzy.FuzzyValue setMatchThreshold 0.1)

而终端,杰西给出了错误:
Jess reported an error in routine new
    while executing (new nrc.fuzzy.FuzzyVariable "distanciaDeCoruscant" 0.0 30000.0 "parsec")
    while executing definition for defglobal ?*gVarDistanciaDeCoruscant*
    while executing (batch "/Users/UNISAL/Documents/AI/StarWars.clp").
  Message: Class nrc.fuzzy.FuzzyVariable not found.
  Program text: ( defglobal ?*gVarDistanciaDeCoruscant* = ( new nrc.fuzzy.FuzzyVariable "distanciaDeCoruscant" 0.0 30000.0 "parsec" ) )  at line 26 in file /Users/UNISAL/Documents/AI/StarWars.clp.

Nested exception is:
nrc.fuzzy.FuzzyVariable

我认为Mac和Linux没有这个适合Jess的包。是否可以添加与Mac和Linux兼容的遗漏软件包?
为了取得好成绩,我需要把我的工作班/作业报告交给老师。
您可以检查整个文档:https://gist.github.com/gusbemacbe/8ad836256edcfb5edbffe206cad6c9e8

最佳答案

基本Jess发行版不包含FuzzyJ;您必须单独安装它,将其包含在类路径中,然后使用FuzzyMain而不是标准的Jess.Main启动。你的老师应该告诉你这些。如果你没有FuzzyJ,你可以从Jess网站的“用户贡献”页面下载它:http://www.jessrules.com/contributions/

09-26 23:10