sfplanner 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +3 -0
- data/README.md +1 -1
- data/Rakefile +16 -0
- data/VERSION +1 -1
- data/sfplanner.gemspec +3 -1
- data/test/files +5 -0
- data/test/test1.inc +9 -0
- data/test/test1.sfp +13 -0
- data/test/test2.sfp +20 -0
- data/test/test3.inc +40 -0
- data/test/test3.sfp +17 -0
- data/test/test4.inc +28 -0
- data/test/test4.sfp +22 -0
- data/test/test6.inc +9 -0
- data/test/test6.sfp +12 -0
- metadata +28 -4
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
SFPlanner
|
2
2
|
=========
|
3
3
|
- Author: Herry (herry13@gmail.com)
|
4
|
-
- [Version](https://github.com/herry13/sfplanner/blob/master/VERSION)
|
5
4
|
- License: [BSD](https://github.com/herry13/sfp-ruby/blob/master/LICENSE)
|
6
5
|
|
6
|
+
[![Build Status](https://travis-ci.org/herry13/sfplanner.png?branch=master)](https://travis-ci.org/herry13/sfplanner)
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/sfplanner.png)](http://badge.fury.io/rb/sfplanner)
|
8
8
|
|
9
9
|
A Ruby script and library of SFP planner, which solves a planning task written in [SFP language](https://github.com/herry13/nuri/wiki/SFP-language).
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
def sfplanner
|
2
|
+
File.dirname(__FILE__) + '/bin/sfplanner'
|
3
|
+
end
|
4
|
+
|
5
|
+
def testfiles
|
6
|
+
dir = File.dirname(__FILE__) + '/test'
|
7
|
+
File.read("#{dir}/files").split("\n").map { |x| "#{dir}/#{x}" }
|
8
|
+
end
|
9
|
+
|
10
|
+
task :default => :test
|
11
|
+
|
12
|
+
namespace :test do
|
13
|
+
testfiles.each do |file|
|
14
|
+
sh("#{sfplanner} #{file}")
|
15
|
+
end
|
16
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/sfplanner.gemspec
CHANGED
data/test/files
ADDED
data/test/test1.inc
ADDED
data/test/test1.sfp
ADDED
data/test/test2.sfp
ADDED
data/test/test3.inc
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
class Service {
|
2
|
+
installed is false
|
3
|
+
running is false
|
4
|
+
|
5
|
+
procedure install {
|
6
|
+
conditions {
|
7
|
+
this.installed is false
|
8
|
+
}
|
9
|
+
effects {
|
10
|
+
this.installed is true
|
11
|
+
}
|
12
|
+
}
|
13
|
+
procedure uninstall {
|
14
|
+
conditions {
|
15
|
+
this.installed is true
|
16
|
+
}
|
17
|
+
effects {
|
18
|
+
this.installed is false
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
procedure start {
|
23
|
+
conditions {
|
24
|
+
this.installed is true
|
25
|
+
this.running is false
|
26
|
+
}
|
27
|
+
effects {
|
28
|
+
this.running is true
|
29
|
+
}
|
30
|
+
}
|
31
|
+
procedure stop {
|
32
|
+
conditions {
|
33
|
+
this.installed is true
|
34
|
+
this.running is true
|
35
|
+
}
|
36
|
+
effects {
|
37
|
+
this.running is false
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
data/test/test3.sfp
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
include "test3.inc"
|
2
|
+
|
3
|
+
// generate all possible states with constraint solver
|
4
|
+
initial state {
|
5
|
+
s1 isa Service
|
6
|
+
s2 isa Service
|
7
|
+
s3 isa Service
|
8
|
+
}
|
9
|
+
goal constraint {
|
10
|
+
s1.running
|
11
|
+
s2.running
|
12
|
+
s3.running
|
13
|
+
}
|
14
|
+
global constraint {
|
15
|
+
if s1.running then s2.running
|
16
|
+
if s2.running then s3.running
|
17
|
+
}
|
data/test/test4.inc
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
schema Service {
|
2
|
+
running is false
|
3
|
+
procedure start {
|
4
|
+
conditions {
|
5
|
+
this.running is false
|
6
|
+
}
|
7
|
+
effects {
|
8
|
+
this.running is true
|
9
|
+
}
|
10
|
+
}
|
11
|
+
procedure stop {
|
12
|
+
conditions {
|
13
|
+
this.running is true
|
14
|
+
}
|
15
|
+
effects {
|
16
|
+
this.running is false
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
schema Client {
|
21
|
+
refer isref Service
|
22
|
+
procedure redirect(s isref Service) {
|
23
|
+
conditions { }
|
24
|
+
effects {
|
25
|
+
this.refer is s
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
data/test/test4.sfp
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
include "test4.inc"
|
2
|
+
|
3
|
+
initial state {
|
4
|
+
a isa Service {
|
5
|
+
running is true
|
6
|
+
}
|
7
|
+
|
8
|
+
b isa Service // with "running" is false
|
9
|
+
|
10
|
+
pc isa Client {
|
11
|
+
refer is a
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
goal constraint {
|
16
|
+
pc.refer is b
|
17
|
+
a.running is false
|
18
|
+
}
|
19
|
+
|
20
|
+
global constraint {
|
21
|
+
pc.refer.running is true
|
22
|
+
}
|
data/test/test6.inc
ADDED
data/test/test6.sfp
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfplanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,15 +13,26 @@ date: 2013-08-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sfp
|
16
|
-
requirement: &
|
16
|
+
requirement: &18815260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.3.
|
21
|
+
version: 0.3.17
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *18815260
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &18814780 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *18814780
|
25
36
|
description: A Ruby gem that provides a Ruby API and a script to the SFP planner.
|
26
37
|
This planner can automatically generate a plan that solves a planning problem written
|
27
38
|
in SFP language.
|
@@ -33,8 +44,11 @@ extensions: []
|
|
33
44
|
extra_rdoc_files: []
|
34
45
|
files:
|
35
46
|
- .gitignore
|
47
|
+
- .travis.yml
|
48
|
+
- Gemfile
|
36
49
|
- LICENSE
|
37
50
|
- README.md
|
51
|
+
- Rakefile
|
38
52
|
- VERSION
|
39
53
|
- bin/sfplanner
|
40
54
|
- bin/sfw2graph
|
@@ -47,6 +61,16 @@ files:
|
|
47
61
|
- lib/sfplanner/planner.rb
|
48
62
|
- lib/sfplanner/sas.rb
|
49
63
|
- sfplanner.gemspec
|
64
|
+
- test/files
|
65
|
+
- test/test1.inc
|
66
|
+
- test/test1.sfp
|
67
|
+
- test/test2.sfp
|
68
|
+
- test/test3.inc
|
69
|
+
- test/test3.sfp
|
70
|
+
- test/test4.inc
|
71
|
+
- test/test4.sfp
|
72
|
+
- test/test6.inc
|
73
|
+
- test/test6.sfp
|
50
74
|
homepage: https://github.com/herry13/sfplanner
|
51
75
|
licenses:
|
52
76
|
- BSD
|