Comments (3)
Hi @AlonBenAriVA — I noticed two things that are causing issues.
- In your
draw
function, you haveenvironment.tick();
commented out. This needs to run in order for theCanvasRenderer
to draw anything to the screen. - You are attempting to connect agents in the
Network
within the samefor
loop that adds agents to theEnvironment
andNetwork
in the first place. You should instead connect these agents after that initialfor
loop, like this:
function setup() {
// get some agents
for (let i = 0; i < nodeNum; i++) {
const agent = new Agent();
agent.set("size", 5);
agent.set("color", "#F00");
//agent.addRule(tick);
//
environment.addAgent(agent);
network.addAgent(agent);
}
// after adding agents to the environment and network, add a few edges
network.connect(network.get(1), network.get(2));
network.connect(network.get(2), network.get(5));
network.connect(network.get(0), network.get(0));
network.connect(network.get(2), network.get(7));
}
Please let me know if this helps!
from flocc.
@AlonBenAriVA just wanted to check in again and see if my answer above helped with your issue.
from flocc.
Closing this due to inactivity.
from flocc.
Related Issues (17)
- Array methods, lambdas for rules HOT 1
- Cannot change color of agents HOT 5
- Histogram improvements HOT 1
- Histogram buckets for discrete values HOT 1
- 0.3.14 ideas HOT 1
- CanvasRenderer + Network connection drawing issue HOT 1
- TypeScript improvements HOT 1
- KDTree bug HOT 1
- Network should safely handle `.neighbors(agent)` call when `agent` is not in network HOT 1
- Fix JSDoc declaration for `Terrain.neighbors` HOT 1
- Let's have Networks and Terrains automatically sync with all Agents in their Environment
- Histogram: Multiple Metrics HOT 1
- Heatmaps! HOT 1
- Calling environment.set(data) when subclassing doesn't set data
- Terrain.load can't be used from server side nodejs simulation HOT 3
- developping locally HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flocc.