滞后是什么意思以及它如何应用于计算机科学或编程?
我正在查看一些代码,看到了关于“滞后”的断章取义的评论。我想我已经弄清楚代码的作用,所以我的问题不涉及任何具体内容。我根本不明白这个术语的含义或它如何应用于编程。我环顾四周,看到了一些数学定义,但想了解更多信息。据我所知,滞后与根据 X 过去发生的情况预测或假设 X 的给定状态有关?
I was looking at some code and saw an out of context comment about 'hysteresis.' I think I have figured out what the code does so my question doesn't involve anything specific. I simply do not understand what the term means or how it is applicable in programming. I looked around and saw some mathmatic definitions but would like some more information. From what I can tell Hysteresis has something to do with predicting or assuming a given state for X based on what has happened to X in the past?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
滞后现象描述了一个系统,其行为(输出)不仅取决于其在时间t的输入,还取决于其过去的行为及其所遵循的路径。
一种众所周知的具有滞后现象的装置是恒温器。想象一下一个恒温器,可以在 70°F 的温度下打开和关闭供暖。当温度在 70°F 左右时,虽然有一点波动,恒温器会不断地打开和关闭供暖。一般来说,恒温器具有迟滞功能:它将在 69°F 时开启加热,但在 71°F 时关闭加热。这避免了连续的切换。
编辑:看看维基百科的文章。
Hysteresis characterizes a system whose behavior (output) does not only depend on its input at time t, but also on its past behavior, on the path it has followed.
A well-known device that exhibits hysteresis is a thermostat. Imagine a thermostat that would switch on and off heating at 70°F. When temperature is around 70°F, while fluctuating a bit, the thermostat would continually switch heating on and off. Generally, a thermostat is built with hysteresis: it will switch on heating at (say) 69°F, but switch off heating at 71°F. This avoids the continual switches.
EDIT: have a look at Wikipedia's article.
恒温器示例:
如果只有一个点,系统可能会围绕该点振荡。
在点高度和低点之间,取决于加热器打开或关闭的最后值。
Thermostat example:
If there where just one point the system coul'd oscillate around that single point.
Between the points height and low it depends on the last value of the heater if it is on or off.
谷歌是我的朋友:
原则一般指的是任何系统基于先前状态的变化行为。因此,您可以使用状态机图或图表对迟滞进行建模。
在用户界面设计中,它指的是使用户界面滞后于用户输入事件或其他事件的实践。单击按钮可能不会立即显示详细信息窗口;相反,会启动一个动画,逐渐改变用户界面。
我认为 Windows 7 任务栏中的那些“已配置设备驱动程序”气泡表现出滞后现象:气泡出现是为了响应操作系统的完成事件,然后开始消失。用户的鼠标悬停事件将重置该计时器,让用户有时间单击气泡以获取有关该事件的详细信息;即使鼠标事件随后位于气泡区域之外,它也会延迟淡入淡出动画。
Google was my friend:
The principle in general refers to the behavior of any system's change, based on previous states. Thus you can model hysteresis with a state machine diagram or a graph.
In user interface design it refers to the practice of making a user interface lag behind user input events or other events. Clicking a button might not immediately display a details window; instead an animation is started which gradually changes the user interface.
I think of those "Device Driver Configured" bubbles in Windows 7's task bar as exhibiting hysteresis: the bubble appears in response to a completion event from the OS, and begins to fade away. A mouse-over event from the user will reset that timer, giving the user time to click on the bubble for details about the event; it delays the fading animation even if the mouse events are thereafter outside the region of the bubble.
好的答案。在实际的集成层中,这一点非常重要。集成层
具有滞后现象本身就是一个子系统。显然,理想的情况是没有滞后(摩尔机);但是,通常每个系统的状态机都存在不匹配,这只能通过使用滞后的转换器来解决。例如,Microsoft Dynamics/Great Plains Field Service 模块在其 SVC00210 Service Master Audit Trail 表中记录状态。每个调用都在某个 SRVSTAT 中。当集成像 ClickSoftware 的服务优化调度程序这样的调度程序时,需要处理其状态。 CS 的状态由自定义实现决定。例如,开放、InRoute、OnSite、不完整、取消、完成。此外,它还具有“部分未完成”的“不完整”状态,尽管这是作为“不完整”中的子状态机实现的。因此,GP 中的转换必须映射到 CS 中。不幸的是,GP 允许(在屏幕上记录呼叫输入)从一种状态转换到自身状态;因此,转换事件不能单独用于触发GP中的状态变化。因此,新的触发事件是 GP 状态转换以及由过去事件集的某些逻辑定义的元状态的组合。正如您所看到的,滞后现象很快使问题从简单变得复杂。在计算机科学术语中,理想的是摩尔机,但实用的是米利机。我更喜欢把它想象成面粉,里面有虫子等等!
我认为可以从任何 Mealy 机生产出摩尔机,摩尔机只会有更多的状态。请参阅:Mealy v/s。摩尔
Good answers. In practical integration layers, this is very important. An integration layer
with hysteresis is itself a subsystem. Clearly, the ideal is no hysteresis (a Moore machine); but, typically there is a mismatch in the state machines of each of the systems and this can only be solved by a translator using hysteresis. For instance, Microsoft Dynamics/Great Plains Field Service module records state in its SVC00210 Service Master Audit Trail table. Each Call is in some SRVSTAT. When integrating a scheduler like ClickSoftware's service optimization scheduler then one needs to work with its state. The state of CS is determined by the custom implementation. E.g. Open, InRoute, OnSite, Incomplete, Cancelled, Complete. Additionally, it also has a state of Incomplete with Parts Pending although this is implemented as a sub- State Machine within Incomplete. So, transitions in GP must be mapped into CS. Unfortunately, GP allows (does record on screen input for a call) transitions from one state to itself; so, thus, the transition event cannot be used solely for triggering the state change in GP. Therefore, the new trigger event is a combination of the GP state transition as well as a meta-state defined by some logic on the set of past events. As you can see, hysteresis quickly takes the problem from simple to complex. In computer science terms the ideal is a Moore Machine but the practical is the Mealy Machine. I prefer to think of it like Mealy flour with bugs living in it and all!
I think its possible to produce a Moore machine from any Mealy machine, the Moore machine will simply have more states. See: Mealy v/s. Moore
它在工程中也被大量使用。例如,在视频游戏中,如果存在导致大量切换而没有良好结果的逻辑,则可以为问题添加滞后,并导致对象在一段时间内向特定方向变化,从而避免抽搐问题。类似于电子设备中使用施密特触发器所做的事情 - 避免不断的切换,这种切换不会将系统推入新的状态,而是导致系统在一种状态下振动并且无法退出。非常简单的概念很有帮助。
在 youtube 中搜索“berserk hysteresis”查看示例。如果没有迟滞,游戏中的机器人实际上只会抽搐,根本不会移动(当有很多活动正在进行时)。
It's also used a lot in engineering. For example in video games if there is logic that is causing a lot of switching without a good result you can add hysteresis to the problem, and cause the objects to commit to a particular direction for a period of time which can avoid twitching issues. Similar to what is done in electronics with Schmidt triggers - to avoid constant switching that does not push the system into a new state, but causes the system to vibrate in one state and not be able to get out. Very simple concept that is helpful.
Search 'berserk hysteresis' in youtube for an example. Without hysteresis the robots in the game would literally just twitch around and not hardly move at all (when there is a lot of activity going on).
不能比维基百科文章的第一句更简洁了:
TS;NM
关于迟滞概念的有趣观点在 中表达滞后作为生命文章:
Can't put it more succinctly, than first sentence of Wikipedia article:
TS;NM
An interesting view on the notion of hysteresis is expressed in Hysteresis As Life article: