tensai-agents 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +119 -0
- data/lib/tensai/agents/agent.rb +27 -0
- data/lib/tensai/agents/sensor.rb +36 -0
- data/lib/tensai/agents/version.rb +7 -0
- data/lib/tensai/agents.rb +9 -0
- data/tensai-agents.gemspec +35 -0
- metadata +67 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3cf6096a9ce134785b37874398afd949cb3e62c913bfff2d292ea0426bc4bc9d
|
4
|
+
data.tar.gz: b8a81de283a7f37334c8de096ee4bbaf95f9bad7e9dfe33d4ac0081d4feeb7a0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6398dd1c0f8d52b6f56cda4c94747b78fb22f471b8898a85603db9b0b3711d37e888d18218bfd764a309563e1c0ad8b4a22d4c0117f66b22a395cf3f85a1c5f7
|
7
|
+
data.tar.gz: 534361441b7952e489f12ff4d7f003823d14a073df1c3dc268c47d2016cf33c42f177dd8fe40143b29092f75305aa81d4a4bbd4690b3db9b3c2ddc227a6f9766
|
data/.rspec
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in tensai.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
group :development, :test do
|
9
|
+
gem 'rspec', '~> 3.0'
|
10
|
+
gem 'rubocop', '~> 0.74'
|
11
|
+
gem 'rubocop-rspec', '~> 1.35'
|
12
|
+
gem 'guard', '~> 2.15'
|
13
|
+
gem 'guard-rspec', '~> 4.7'
|
14
|
+
gem 'pry-byebug', '~> 3.7'
|
15
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tensai-agents (0.1.0)
|
5
|
+
tensai-core (~> 0.1.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.0)
|
11
|
+
byebug (11.0.1)
|
12
|
+
coderay (1.1.2)
|
13
|
+
concurrent-ruby (1.1.5)
|
14
|
+
diff-lcs (1.3)
|
15
|
+
dry-configurable (0.8.3)
|
16
|
+
concurrent-ruby (~> 1.0)
|
17
|
+
dry-core (~> 0.4, >= 0.4.7)
|
18
|
+
dry-container (0.7.2)
|
19
|
+
concurrent-ruby (~> 1.0)
|
20
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
21
|
+
dry-core (0.4.9)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-equalizer (0.2.2)
|
24
|
+
dry-inflector (0.1.2)
|
25
|
+
dry-logic (1.0.3)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-core (~> 0.2)
|
28
|
+
dry-equalizer (~> 0.2)
|
29
|
+
dry-types (1.1.1)
|
30
|
+
concurrent-ruby (~> 1.0)
|
31
|
+
dry-container (~> 0.3)
|
32
|
+
dry-core (~> 0.4, >= 0.4.4)
|
33
|
+
dry-equalizer (~> 0.2, >= 0.2.2)
|
34
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
35
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
36
|
+
ffi (1.11.1)
|
37
|
+
formatador (0.2.5)
|
38
|
+
guard (2.15.1)
|
39
|
+
formatador (>= 0.2.4)
|
40
|
+
listen (>= 2.7, < 4.0)
|
41
|
+
lumberjack (>= 1.0.12, < 2.0)
|
42
|
+
nenv (~> 0.1)
|
43
|
+
notiffany (~> 0.0)
|
44
|
+
pry (>= 0.9.12)
|
45
|
+
shellany (~> 0.0)
|
46
|
+
thor (>= 0.18.1)
|
47
|
+
guard-compat (1.2.1)
|
48
|
+
guard-rspec (4.7.3)
|
49
|
+
guard (~> 2.1)
|
50
|
+
guard-compat (~> 1.1)
|
51
|
+
rspec (>= 2.99.0, < 4.0)
|
52
|
+
jaro_winkler (1.5.3)
|
53
|
+
listen (3.1.5)
|
54
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
55
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
56
|
+
ruby_dep (~> 1.2)
|
57
|
+
lumberjack (1.0.13)
|
58
|
+
method_source (0.9.2)
|
59
|
+
nenv (0.3.0)
|
60
|
+
notiffany (0.1.3)
|
61
|
+
nenv (~> 0.1)
|
62
|
+
shellany (~> 0.0)
|
63
|
+
parallel (1.17.0)
|
64
|
+
parser (2.6.4.1)
|
65
|
+
ast (~> 2.4.0)
|
66
|
+
pry (0.12.2)
|
67
|
+
coderay (~> 1.1.0)
|
68
|
+
method_source (~> 0.9.0)
|
69
|
+
pry-byebug (3.7.0)
|
70
|
+
byebug (~> 11.0)
|
71
|
+
pry (~> 0.10)
|
72
|
+
rainbow (3.0.0)
|
73
|
+
rb-fsevent (0.10.3)
|
74
|
+
rb-inotify (0.10.0)
|
75
|
+
ffi (~> 1.0)
|
76
|
+
rspec (3.8.0)
|
77
|
+
rspec-core (~> 3.8.0)
|
78
|
+
rspec-expectations (~> 3.8.0)
|
79
|
+
rspec-mocks (~> 3.8.0)
|
80
|
+
rspec-core (3.8.2)
|
81
|
+
rspec-support (~> 3.8.0)
|
82
|
+
rspec-expectations (3.8.4)
|
83
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
+
rspec-support (~> 3.8.0)
|
85
|
+
rspec-mocks (3.8.1)
|
86
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
87
|
+
rspec-support (~> 3.8.0)
|
88
|
+
rspec-support (3.8.2)
|
89
|
+
rubocop (0.74.0)
|
90
|
+
jaro_winkler (~> 1.5.1)
|
91
|
+
parallel (~> 1.10)
|
92
|
+
parser (>= 2.6)
|
93
|
+
rainbow (>= 2.2.2, < 4.0)
|
94
|
+
ruby-progressbar (~> 1.7)
|
95
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
96
|
+
rubocop-rspec (1.35.0)
|
97
|
+
rubocop (>= 0.60.0)
|
98
|
+
ruby-progressbar (1.10.1)
|
99
|
+
ruby_dep (1.5.0)
|
100
|
+
shellany (0.0.1)
|
101
|
+
tensai-core (0.1.1)
|
102
|
+
dry-types (~> 1.1)
|
103
|
+
thor (0.20.3)
|
104
|
+
unicode-display_width (1.6.0)
|
105
|
+
|
106
|
+
PLATFORMS
|
107
|
+
ruby
|
108
|
+
|
109
|
+
DEPENDENCIES
|
110
|
+
guard (~> 2.15)
|
111
|
+
guard-rspec (~> 4.7)
|
112
|
+
pry-byebug (~> 3.7)
|
113
|
+
rspec (~> 3.0)
|
114
|
+
rubocop (~> 0.74)
|
115
|
+
rubocop-rspec (~> 1.35)
|
116
|
+
tensai-agents!
|
117
|
+
|
118
|
+
BUNDLED WITH
|
119
|
+
2.0.1
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'tensai/types'
|
4
|
+
require 'tensai/util/initializer'
|
5
|
+
|
6
|
+
module Tensai
|
7
|
+
module Agents
|
8
|
+
#
|
9
|
+
# Agent
|
10
|
+
#
|
11
|
+
class Agent
|
12
|
+
include Util::Initializer.new(
|
13
|
+
sensors: Types::Strict::Array
|
14
|
+
)
|
15
|
+
|
16
|
+
#
|
17
|
+
# Execute one cycle of agent activity.
|
18
|
+
# This includes processing percepts, decision making and acting.
|
19
|
+
#
|
20
|
+
# @param context Execution context
|
21
|
+
#
|
22
|
+
def act(context) # rubocop:disable Lint/UnusedMethodArgument
|
23
|
+
raise NotImplementedError
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'tensai/types'
|
4
|
+
require 'tensai/util/initializer'
|
5
|
+
|
6
|
+
module Tensai
|
7
|
+
module Agents
|
8
|
+
#
|
9
|
+
# Agent sensor
|
10
|
+
#
|
11
|
+
class Sensor
|
12
|
+
include Util::Initializer.new(
|
13
|
+
agent: Types::Any
|
14
|
+
)
|
15
|
+
|
16
|
+
#
|
17
|
+
# Process input from environment and produce percepts.
|
18
|
+
# (see #percepts)
|
19
|
+
#
|
20
|
+
# @param input Sensoric input from the environment
|
21
|
+
#
|
22
|
+
def process_input(input) # rubocop:disable Lint/UnusedMethodArgument
|
23
|
+
raise NotImplementedError
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Percepts produced by recent sensor input.
|
28
|
+
#
|
29
|
+
# @return [Enumerable] List of percepts
|
30
|
+
#
|
31
|
+
def percepts
|
32
|
+
raise NotImplementedError
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'tensai/agents/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'tensai-agents'
|
9
|
+
spec.version = Tensai::Agents::VERSION
|
10
|
+
spec.authors = ['Kevin Fischer']
|
11
|
+
spec.email = ['kfischer_okarin@yahoo.co.jp']
|
12
|
+
|
13
|
+
spec.summary = 'Agent Framework'
|
14
|
+
spec.homepage = 'https://github.com/kfischer-okarin/tensai'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/kfischer-okarin/tensai/tree/master/agents'
|
20
|
+
# spec.metadata['changelog_uri'] = 'https://github.com/kfischer-okarin/tensai/CHANGELOG.md'
|
21
|
+
else
|
22
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
23
|
+
end
|
24
|
+
|
25
|
+
# Specify which files should be added to the gem when it is released.
|
26
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
28
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
|
+
end
|
30
|
+
spec.bindir = 'exe'
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ['lib']
|
33
|
+
|
34
|
+
spec.add_dependency 'tensai-core', '~> 0.1.1'
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tensai-agents
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Fischer
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tensai-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.1
|
27
|
+
description:
|
28
|
+
email:
|
29
|
+
- kfischer_okarin@yahoo.co.jp
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".rspec"
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
37
|
+
- lib/tensai/agents.rb
|
38
|
+
- lib/tensai/agents/agent.rb
|
39
|
+
- lib/tensai/agents/sensor.rb
|
40
|
+
- lib/tensai/agents/version.rb
|
41
|
+
- tensai-agents.gemspec
|
42
|
+
homepage: https://github.com/kfischer-okarin/tensai
|
43
|
+
licenses:
|
44
|
+
- MIT
|
45
|
+
metadata:
|
46
|
+
homepage_uri: https://github.com/kfischer-okarin/tensai
|
47
|
+
source_code_uri: https://github.com/kfischer-okarin/tensai/tree/master/agents
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
requirements: []
|
63
|
+
rubygems_version: 3.0.6
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Agent Framework
|
67
|
+
test_files: []
|