虽然我理解模拟和模拟的一般含义,但我几乎总是对它们感到困惑。假设我创建了一个模仿现有硬件/软件的软件,我应该如何称呼它?模拟器还是模拟器?

有人能从编程的角度来解释一下吗?

福利:这两个词在英语中有什么区别?(对不起,我的母语不是英语:))


当前回答

模拟器是真实系统的替代品,但模拟器用于优化、理解和估计真实系统。

其他回答

模拟是模拟外部可观察到的行为以匹配现有目标的过程。模拟机制的内部状态不必准确地反映它所模拟的目标的内部状态。

另一方面,仿真涉及到对目标的基本状态进行建模。一个好的仿真的最终结果是,仿真模型将模拟它所模拟的目标。

理想情况下,您应该能够查看模拟并观察到您在查看原始目标时也会看到的属性。在实践中,由于性能原因,模拟可能存在一些快捷方式——也就是说,模拟的某些内部方面实际上可能是模拟。

MAME是一款街机游戏模拟器;Hyperterm是一个(不是很好的)终端仿真器。没有必要为街机或终端详细建模以获得所需的模拟行为。

《Flight Simulator》是一款模拟器;SPICE是一个电子模拟器。他们尽可能地模拟目标的每个细节,以表示目标在现实中的行为。

EDIT: Other responses have pointed out that the goal of an emulation is to able to substitute for the object it is emulating. That's an important point. A simulation's focus is more on the modeling of the internal state of the target -- and the simulation does not necessarily lead to emulation. In particular, a simulation may run far slower than real-time. SPICE, for example, cannot substitute for an actual electronics circuit (even if assuming there was some kind of magical device that perfectly interfaces electrical circuits to a SPICE simulation.) A simulation does not always lead to emulation --

仿真器是一个系统的模型,它可以接受被仿真系统可以接受的任何有效输入,并产生相同的输出或结果。所以你的软件就是一个模拟器,只要它能精确地再现被仿真系统的行为。

简单的解释。

如果你想把你的电脑(运行Windows)转换成Mac,你可以做以下任何一项:

你可以简单地在你的Windows上安装一个Mac主题。所以,你的电脑感觉上更像Mac,但实际上你不能运行任何Mac程序。(模拟)

(or)

(2)你可以把你的电脑编程成像Mac一样运行(我不确定这是否可能:P)。现在你甚至可以成功地运行Mac程序,并期望得到与Mac上相同的输出。

在第一种情况下,你可以体验Mac,但你不能期待与Mac相同的输出。 在第二种情况下,你可以期待与Mac上相同的输出,但事实仍然是它只是一台PC。

如果一个飞行模拟器可以把你从a带到B,那么它就是一个飞行模拟器。

仿真器可以代替原来的,以供实际使用。 虚拟PC是一种模拟PC的设备。

模拟器是用于研究和分析的模型。

模拟器总是必须接近实时运行。对于模拟器来说,情况并非总是如此。地质模拟可以做到1000年/秒甚至更久。

To understand the difference between a simulator and an emulator, keep in mind that a simulator tries to mimic the behavior of a real device. For example, in the case of the iOS Simulator, it simulates the real behavior of an actual iPhone/iPad device. However, the Simulator itself uses the various libraries installed on the Mac (such as QuickTime) to perform its rendering so that the effect looks the same as an actual iPhone. In addition, applications tested on the Simulator are compiled into x86 code, which is the byte-code understood by the Simulator. A real iPhone device, conversely, uses ARM-based code.

相比之下,模拟器模拟真实设备的工作。在模拟器上测试的应用程序被编译成实际设备使用的实际字节码。仿真器通过将字节码转换为可由运行仿真器的主机执行的形式来执行应用程序。

为了理解模拟和模拟之间的微妙区别,假设您试图说服一个孩子玩刀是危险的。为了模拟这种情况,你假装用刀割伤自己,并痛苦地呻吟。为了模仿这一点,你真的会割伤自己。