docs(README.md): Add definition for alpha (#139)

* docs(README.md): Add definition for `alpha`

- Alpha didn't have a meaningful definition and assumed people already knew what it was.
- Also added link to Simulation-Restart to reference the idea presented there of "reheating" the simulation

fix: https://github.com/d3/d3-force/pull/139#issuecomment-655488430

Co-authored-by: Philippe Rivière <fil@rezo.net>
This commit is contained in:
Joel Louzado 2020-07-10 21:47:40 +05:30 committed by GitHub
parent 194dba9ed9
commit 051f8d3976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,6 +85,8 @@ If the specified array of *nodes* is modified, such as when nodes are added to o
<a name="simulation_alpha" href="#simulation_alpha">#</a> <i>simulation</i>.<b>alpha</b>([<i>alpha</i>]) [<>](https://github.com/d3/d3-force/blob/master/src/simulation.js#L98 "Source")
*alpha* is roughly analogous to temperature in [simulated annealing](https://en.wikipedia.org/wiki/Simulated_annealing#Overview). It decreases over time as the simulation “cools down”. When *alpha* reaches *alphaMin*, the simulation stops; see [*simulation*.restart](#simulation_restart).
If *alpha* is specified, sets the current alpha to the specified number in the range [0,1] and returns this simulation. If *alpha* is not specified, returns the current alpha value, which defaults to 1.
<a name="simulation_alphaMin" href="#simulation_alphaMin">#</a> <i>simulation</i>.<b>alphaMin</b>([<i>min</i>]) [<>](https://github.com/d3/d3-force/blob/master/src/simulation.js#L102 "Source")