MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

physics/n_body_simulation.py:121–131  ·  view source on GitHub ↗
(
        self,
        bodies: list[Body],
        gravitation_constant: float = 1.0,
        time_factor: float = 1.0,
        softening_factor: float = 0.0,
    )

Source from the content-addressed store, hash-verified

119 """
120
121 def __init__(
122 self,
123 bodies: list[Body],
124 gravitation_constant: float = 1.0,
125 time_factor: float = 1.0,
126 softening_factor: float = 0.0,
127 ) -> None:
128 self.bodies = bodies
129 self.gravitation_constant = gravitation_constant
130 self.time_factor = time_factor
131 self.softening_factor = softening_factor
132
133 def __len__(self) -> int:
134 return len(self.bodies)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected