← All procedures

generators.familyPoints

This function gives the points of the family at the points of a unit design.

CLI
Package
@procedures/generators · README
Path
["generators","familyPoints"]
CLI
mark generators familyPoints --family <object> --unit <number[][]> --r <object>
As data
{"$proc":["generators","familyPoints"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/generators/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["generators","familyPoints"], { family: {}, unit: [], r: {} });
console.log(JSON.stringify(result));

From the command line

$ mark generators familyPoints --family <object> --unit <number[][]> --r <object>

As data, in a program

{
  "$proc": ["generators", "familyPoints"],
  "input": { "family": {}, "unit": [], "r": {} }
}

Input

FieldTypeRequiredDefaultDescription
familyobjectyes
unitnumber[][]yes
robjectyesThe input of random: the procedure makes the Random with random(seed) before the call.

Output

The schema does not list fields (object[]).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "family": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the dimension. It is a key of each point."
                },
                "min": {
                  "type": "number",
                  "description": "The smallest value."
                },
                "max": {
                  "type": "number",
                  "description": "The largest value. A uniform or log dimension that is not `integer` gets values below `max`."
                },
                "distribution": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "family": {
                          "type": "string",
                          "const": "beta"
                        },
                        "a": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        },
                        "b": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        }
                      },
                      "required": [
                        "family",
                        "a",
                        "b"
                      ],
                      "additionalProperties": {}
                    },
                    {
                      "type": "object",
                      "properties": {
                        "family": {
                          "type": "string",
                          "const": "lognormal"
                        },
                        "mu": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        },
                        "sigma": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        }
                      },
                      "required": [
                        "family",
                        "mu",
                        "sigma"
                      ],
                      "additionalProperties": {}
                    },
                    {
                      "type": "object",
                      "properties": {
                        "family": {
                          "type": "string",
                          "const": "mixture"
                        },
                        "parts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "weight": {
                                "type": "number"
                              },
                              "part": {
                                "$ref": "#/definitions/__schema0"
                              }
                            },
                            "required": [
                              "weight",
                              "part"
                            ],
                            "additionalProperties": {}
                          }
                        }
                      },
                      "required": [
                        "family",
                        "parts"
                      ],
                      "additionalProperties": {}
                    },
                    {
                      "type": "object",
                      "properties": {
                        "family": {
                          "type": "string",
                          "const": "pareto"
                        },
                        "scale": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        },
                        "shape": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        }
                      },
                      "required": [
                        "family",
                        "scale",
                        "shape"
                      ],
                      "additionalProperties": {}
                    },
                    {
                      "type": "object",
                      "properties": {
                        "family": {
                          "type": "string",
                          "const": "recorded"
                        },
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        }
                      },
                      "required": [
                        "family",
                        "values"
                      ],
                      "additionalProperties": {}
                    },
                    {
                      "type": "object",
                      "properties": {
                        "family": {
                          "type": "string",
                          "const": "zipf"
                        },
                        "n": {
                          "type": "number"
                        },
                        "exponent": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "number"
                                }
                              ],
                              "additionalItems": {},
                              "minItems": 2,
                              "maxItems": 2
                            }
                          ]
                        }
                      },
                      "required": [
                        "family",
                        "n",
                        "exponent"
                      ],
                      "additionalProperties": {}
                    }
                  ],
                  "description": "The distribution of the values, cut to the range. Without it, the values are uniform in the range."
                },
                "scale": {
                  "type": "string",
                  "enum": [
                    "linear",
                    "log"
                  ],
                  "description": "With `log`, the logarithm of the value is uniform. `min` must be above 0. A dimension with a distribution has no scale."
                },
                "integer": {
                  "type": "boolean",
                  "description": "With `true`, each value is an integer. `min` and `max` must be integers."
                }
              },
              "required": [
                "name",
                "min",
                "max"
              ],
              "additionalProperties": {}
            }
          }
        },
        "required": [
          "name",
          "dimensions"
        ],
        "additionalProperties": {}
      },
      "unit": {
        "type": "array",
        "items": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "r": {
        "type": "object",
        "properties": {
          "seed": {
            "type": [
              "string",
              "number"
            ]
          }
        },
        "required": [
          "seed"
        ],
        "additionalProperties": false,
        "x-procedures-construct": {
          "function": "random",
          "params": [
            "seed"
          ]
        },
        "description": "The input of random: the procedure makes the Random with random(seed) before the call."
      }
    },
    "required": [
      "family",
      "unit",
      "r"
    ],
    "additionalProperties": false,
    "definitions": {
      "__schema0": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "const": "beta"
              },
              "a": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              },
              "b": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              }
            },
            "required": [
              "family",
              "a",
              "b"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "const": "lognormal"
              },
              "mu": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              },
              "sigma": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              }
            },
            "required": [
              "family",
              "mu",
              "sigma"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "const": "mixture"
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "weight": {
                      "type": "number"
                    },
                    "part": {
                      "allOf": [
                        {
                          "$ref": "#/definitions/__schema0"
                        }
                      ]
                    }
                  },
                  "required": [
                    "weight",
                    "part"
                  ],
                  "additionalProperties": {}
                }
              }
            },
            "required": [
              "family",
              "parts"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "const": "pareto"
              },
              "scale": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              },
              "shape": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              }
            },
            "required": [
              "family",
              "scale",
              "shape"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "const": "recorded"
              },
              "values": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "required": [
              "family",
              "values"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "family": {
                "type": "string",
                "const": "zipf"
              },
              "n": {
                "type": "number"
              },
              "exponent": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "array",
                    "items": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "number"
                      }
                    ],
                    "additionalItems": {},
                    "minItems": 2,
                    "maxItems": 2
                  }
                ]
              }
            },
            "required": [
              "family",
              "n",
              "exponent"
            ],
            "additionalProperties": {}
          }
        ]
      }
    }
  },
  "output": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {},
      "additionalProperties": {
        "type": "number"
      }
    }
  }
}