package aulas; public ruleBase ClassificacaoTransportesBase{ rule Ciclo { declarations Transporte t; conditions t.getNumeroRodas() < 4; actions t.setTipoTransporte("ciclo"); } rule Automovel { declarations Transporte t; conditions t.getNumeroRodas() == 4; t.motor(); actions t.setTipoTransporte("automovel"); } rule Bicicleta { declarations Transporte t; conditions t.getTipoTransporte() == "ciclo"; t.getNumeroRodas() == 2; !t.motor(); actions t.setMarca("Bicicleta"); } rule Triciclo { declarations Transporte t; conditions t.getTipoTransporte() == "ciclo"; t.getNumeroRodas() == 3; !t.motor(); actions t.setMarca("Triciclo"); } rule Motocicleta { declarations Transporte t; conditions t.getTipoTransporte() == "ciclo"; t.getNumeroRodas() == 2; t.motor(); actions t.setMarca("Motocicleta"); } rule CarroSport { declarations Transporte t; localdecl Tamanho tam = t.getTamanho(); conditions t.getTipoTransporte() == "automovel"; tam.ehPequeno(); t.setNumeroPortas(2); actions t.setMarca("CarroSport"); } rule Sedan { declarations Transporte t; localdecl Tamanho tam = t.getTamanho(); conditions t.getTipoTransporte() == "automovel"; tam.ehMedio(); t.setNumeroPortas(4); actions t.setMarca("Sedan"); } rule Sedan { declarations Transporte t; localdecl Tamanho tam = t.getTamanho(); conditions t.getTipoTransporte() == "automovel"; tam.ehMedio(); t.setNumeroPortas(3); actions t.setMarca("MiniVan"); } rule UtilitarioSport { declarations Transporte t; localdecl Tamanho tam = t.getTamanho(); conditions t.getTipoTransporte() == "automovel"; tam.ehGrande(); t.setNumeroPortas(4); actions t.setMarca("UtilitarioSport"); } }