什么是状态空间?

发布于 2024-09-28 09:00:05 字数 287 浏览 5 评论 0原文

我正在观看本讲座 (http://www.youtube.com/watch?v =aAb7hSCtvGw&hl=nl),在大约 34 分钟时,提到幻灯片上的一个要点,指出“非常仔细地记录状态空间”。

什么是状态空间?为什么我必须“非常仔细地”记录它?不幸的是,我现在发布的机器上没有声音,但幻灯片本身对我的学习非常有用(如果有声音的话会更有帮助)。

谢谢

I am viewing this lecture (http://www.youtube.com/watch?v=aAb7hSCtvGw&hl=nl) and at about 34 minutes, a bullet point on a slide is mentioned stating "document state space very carefully".

What is state space? Why would I have to document it "very carefully"? Unfortunately, I have no sound on the machine I am posting from right now, but the slides themselves are extremely useful to my learning (it would be even more helpful WITH sound).

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱要勇敢去追 2024-10-05 09:00:05

状态空间是可能状态的集合,在本例中是对象。

在音频中,他基本上是说您需要记录哪些状态下允许哪些操作,以及是否有任何操作更改了对象的状态(这将更改允许的操作集)。他提到这对于可变对象尤其重要。

他使用 Java 中的日期和日历作为存在问题的 API 示例,但没有详细说明。

举一个具体(但简化)的例子,考虑一个 TCP 连接。这基本上有两种状态:开放或封闭。当它关闭时,您无法通过它发送或接收任何内容,因此不允许调用这些方法。

A state space is the set of possible states, in this case of an object.

In the audio, he's basically saying that you need to document which operations are allowed in which states, and if any operation changes the state of the object (which would change the set of permitted operations). He mentions this is especially important for mutable objects.

He uses Date and Calendar from Java as examples of APIs where this is a problem, but doesn't go into specifics.

To give a concrete (but simplified) example, consider a TCP connection. That would basically have two states, open or closed. When it's closed, you can't send or receive anything through it, so calls to those methods are not permitted.

浅黛梨妆こ 2024-10-05 09:00:05

解释一下演讲者所说的,如果对象是可变的,则需要记录状态空间。然后他提到了 Java 的日期和日历 API 在这方面的记录很差。

我猜他的意思是你需要记录任何可以修改代码状态的函数。此外,当是调用这些函数的好(或坏)时间时也是如此。例如,在对象 close() 后调用 read() 函数。

Paraphrasing what the speaker says, if the object is mutable, you need to document the state space. He then references Java's Date and Calendar API being badly documented in this sense.

I'd guess what he means is that you need to document any functions that could modify the state of the code. Also when it is a good (or bad) time to call these functions. Example, calling a read() function after the object is closed().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文