netlogo - 在NetLogo中实现碰撞的最简单方法

标签 netlogo

实现碰撞的最简单方法是什么? 假设所有粒子都具有相同的速度和相同的质量,但方向不同。即使在碰撞后,它们的速度和质量仍然保持不变,但前进方向发生了变化。 是否可以实现两个以上粒子之间的碰撞?

最佳答案

这是一个example implementation遵循以下规则:

Particles behave according to the following rules:

  1. A particle moves in a straight line without changing its speed, unless it collides with another particle or bounces off the wall. The particles are aimed to hit each other at the origin.
  2. Two particles "collide" if they find themselves on the same patch (the world is composed of a grid of small squares called patches).
  3. A random axis is chosen, as if they are two balls that hit each other and this axis is the line connecting their centers.
  4. They exchange momentum and energy along that axis, according to the conservation of momentum and energy. This calculation is done in the center of mass system.
  5. Each turtle is assigned its new velocity, energy, and heading.
  6. If a turtle finds itself on or very close to a wall of the container, it "bounces" -- that is, reflects its direction and keeps its same speed.

如果您对此逻辑的任何部分有具体问题,请随时发表评论。

关于netlogo - 在NetLogo中实现碰撞的最简单方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24711128/

相关文章:

netlogo - 在netlogo上,如何要求海龟设置随机ycor但仍小于1

NetLogo - 寻找具有最大值的补丁

optimization - NetLogo 速度黑客?

list - 如何在 NetLogo 中创建一个包含从 1 到给定数字的数字的列表?

networking - 如何在两个品种龟代理之间使用 create-<breeds>-with?

netlogo - netlogo 中的处理顺序

parameters - NetLogo - 将参数设置为整​​数

netlogo - 在 Netlogo 中处理列表中的索引位置

netlogo - 如何移动不同颜色斑 block 中的海龟

random - 网络标志 : How to make sure a variable stays in a defined range?