bjoernffm/step-functions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bjoernffm/step-functions

Composer 安装命令:

composer require bjoernffm/step-functions

包简介

Step Functions for php

README 文档

README

GitHub GitHub release (latest by date) GitHub top language Build Status Codacy Badge StyleCI

Step Functions is a library which offers implementation of step functions. Define one or multiple functions, define the bounds where they are in use and this library will interpolate between the functions.

Installation

This library is provided as Composer package. To install it, simply execute the folowing command:

composer require bjoernffm/step-functions

Note: This library requires PHP 7.2.

Usage

The simplest usage that will mostly fulfill your needs is to define one or more functions and add them to an interpolator instance:

<?php

use bjoernffm\stepFunctions\StepFunction;
use bjoernffm\stepFunctions\Interpolator;

require 'vendor/autoload.php';

$first = new StepFunction(0, 1, function($input) { return $input; });
$second = new StepFunction(1, 2, function($input) { return -1*$input+2; });

$interpolator = new Interpolator();
$interpolator->add($first);
$interpolator->add($second);

echo $interpolator->getValue(0); // output 0
echo $interpolator->getValue(0.5); // output 0.5
echo $interpolator->getValue(1); // output 1
echo $interpolator->getValue(1.5); // output 0.5
echo $interpolator->getValue(2); // output 0

Contributing

Do you want to help improving this project? Simply fork it and post a pull request. You can do everything on your own, you don't need to ask if you can, just do all the awesome things you want!

This project is published under Apache-2.0 license.

统计信息

  • 总下载量: 811
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-11-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固