Skip to content

Latest commit

 

History

History
49 lines (28 loc) · 1.8 KB

arrangement.md

File metadata and controls

49 lines (28 loc) · 1.8 KB

Arrangement

from tdw.proc_gen.arrangements.arrangement import Arrangement

Abstract base class for procedurally-generated spatial arrangements of objects.


Class Variables

Variable Type Description Value
DEFAULT_CELL_SIZE float The default span used for arranging objects next to each other. 0.6096
MODEL_CATEGORIES Dict[str, List[str]] A dictionary of all of the models that may be used for procedural generation. Key = The category. Value = A list of model names. Note that this category overlaps with, but is not the same as, model_record.wcategory; see: Arrangement.get_categories_and_wcategories(). loads(Path(resource_filename(__name__, "data/models.json")).read_text())

Fields

  • object_ids A list of all of the object IDs in this arrangement.

Functions

__init__

Arrangement(position)

Arrangement(position, rng=None)

Parameter Type Default Description
position Dict[str, float] The position of the root object. This might be adjusted.
rng Union[int, np.random.RandomState] None Either a random seed or an numpy.random.RandomState object. If None, a new random number generator is created.

get_categories_and_wcategories

Arrangement.get_categories_and_wcategories()

(Static)

Returns: A dictionary of the categories of every model that can be used by Arrangement and their corresponding wcategory and wnid. Key = The model name. Value = A dictionary with the following keys: "category" (the ProcGenObjects category), "wcategory" (the value of record.wcategory), and "wnid" (the value of record.wnid).

get_commands

self.get_commands()

Returns: A list of commands that will generate the arrangement.