43. モデルの選択
if then
if then
if then
プロダクションルール
システム
main.c util.c
main.h util.h
app
依存ネットワーク
Y Y 20
Y N 10
N Y 5
N N 0
デシジョンテーブル
マーチン・ファウラーの本に載っている例の一部を紹介。使えそうなものを検討する。
52. def_rule "大都市近郊区間内のみをご利用になる場合の特例(大阪)" do |rule|
rule.add_condition do |route|
area("大都市近郊区間(大阪)").contains?(route)
end
rule.add_action do |route|
from, to = route.fromto
route.replace(area("大都市近郊区間(大阪)").shortest_path(from, to))
end
end
def_rule "分岐駅を通過する列車に乗車する場合の特例(尼崎―大阪)" do |rule|
rule.add_condition do |route|
route.contains?(path("尼崎分岐駅通過特例パターン"))
end
…
end
…