Code Monkey home page Code Monkey logo

v1's Issues

Agent.add_submodule: error persists after trying to add a component

Component を Agent に足そうとするとエラーになります(仕様)が、
その後で通常の Module を足しても同じエラーが出てしまいます。

ログ:

import numpy as np
import brica1
CompA = brica1.ConstantComponent()
ModA = brica1.Module()
ModA.add_component("CompA", CompA)
s = brica1.VirtualTimeSyncScheduler()
agent = brica1.Agent(s)
agent.add_submodule("ModA", ModA)
agent.add_submodule("ModA", ModA) ← add_submoduleを2度呼んでも大丈夫
agent.add_submodule("CompA", CompA) ← Component を Agent に足そうとするとエラー
Traceback (most recent call last):
File "", line 1, in
File "brica1/module.py", line 232, in add_submodule
self.update_scheduler()
File "brica1/module.py", line 217, in update_scheduler
self.scheduler.update(self)
File "brica1/scheduler.py", line 70, in update
self.components = ca.get_all_components()
File "brica1/module.py", line 156, in get_all_components
for submodule in self.get_all_submodules():
File "brica1/module.py", line 95, in get_all_submodules
array.extend(submodule.get_all_submodules())
AttributeError: 'ConstantComponent' object has no attribute 'get_all_submodules'
agent.add_submodule("ModA", ModA) ← 通常の Module を足しても同じエラー
Traceback (most recent call last):
File "", line 1, in
File "brica1/module.py", line 232, in add_submodule
self.update_scheduler()
File "brica1/module.py", line 217, in update_scheduler
self.scheduler.update(self)
File "brica1/scheduler.py", line 70, in update
self.components = ca.get_all_components()
File "brica1/module.py", line 156, in get_all_components
for submodule in self.get_all_submodules():
File "brica1/module.py", line 95, in get_all_submodules
array.extend(submodule.get_all_submodules())
AttributeError: 'ConstantComponent' object has no attribute 'get_all_submodules'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.