Remove remarks in the documentation that suggest mj_name2id is inefficient.

`mj_name2id` has been replaced by a hash map lookup in 2.3.2.

PiperOrigin-RevId: 507816210
Change-Id: I3ee038fa6ec3258d51218588a43398f98a0f6de2
This commit is contained in:
Saran Tunyasuvunakool
2023-02-07 10:12:49 -08:00
committed by Copybara-Service
parent e4b094732b
commit 15b6e6f060
+3 -4
View File
@@ -279,8 +279,7 @@ joints, for example through ``d.joint('foo').qpos`` and ``d.joint('foo').qvel``,
differ between accessors depending on the joint's type. differ between accessors depending on the joint's type.
Named access is guaranteed to be O(1) in the number of entities in the model. In other words, the time it takes to Named access is guaranteed to be O(1) in the number of entities in the model. In other words, the time it takes to
access an entity by name does not grow with the number of names or entities in the model. (This is currently **not** the access an entity by name does not grow with the number of names or entities in the model.
case for the :ref:`mj_name2id` function, which performs a linear scan.)
For completeness, we provide here a complete list of all name categories in MuJoCo, along with their corresponding For completeness, we provide here a complete list of all name categories in MuJoCo, along with their corresponding
aliases defined in the Python API. aliases defined in the Python API.
@@ -433,8 +432,8 @@ this functionality, but this list can be easily constructed using ``model.jnt_qp
mujoco-py creates dicts in ``MjSim`` that allow for efficient lookup of indices for objects of different types: mujoco-py creates dicts in ``MjSim`` that allow for efficient lookup of indices for objects of different types:
``site_name2id``, ``body_name2id`` etc. These functions replace the function :ref:`mujoco.mj_name2id(model, type_enum, ``site_name2id``, ``body_name2id`` etc. These functions replace the function :ref:`mujoco.mj_name2id(model, type_enum,
name) <mj_name2id>` whose current implementation is inefficient. ``mujoco`` offers a different name) <mj_name2id>`. ``mujoco`` offers a different approach for using entity names – :ref:`named access <PyNamed>`,
approach for using entity names – :ref:`named access <PyNamed>`, as well as access to the native :ref:`mj_name2id`. as well as access to the native :ref:`mj_name2id`.
``sim.save(fstream, format_name)`` ``sim.save(fstream, format_name)``
---------------------------------- ----------------------------------