<?php require_once "threshold.php"; if (isset($_POST['years'])) { echo $_POST['years']; $s = new Threshold(); $s->setThresholdPeriod($_POST['years'] / 12); }
<aside class="asideLeft"></aside> </header> <aside class="asideLeftIcons"> <nav> <a href="index.php" class="aBack">Back</a> <a href="recruitmentSessionHelp.php" class="aHelp">Help</a> </nav> </aside> <section class="formSectionRight"> <form id="Form" method="post"> Threshold period in months : <input type="number" step="1" required class="FormNumberInput" min=0 id="thresholdYears" size ="2" name="ThresholdYears" style="width:50px" value=<?php $t = new Threshold(); echo round($t->getThresholdPeriod() * 12); ?> /> <br/> <br/> <input id="btnID" name="change" type="button" value="Save" /> <input type="reset" value="Cancel"/> </form> </section> <footer>Copyright 2015 ©</footer> </div> </body>
public function testSimpleArray() { $DP = new Threshold(array(0, 2, 4, 6, 5, 7, 4, 8, 10, 0), 0); $DP->runSmoothing(); $this->assertEquals(array(0, 6, 5, 7, 4, 10, 0), $DP->smoothedData()); $this->assertEquals(array(0, 3, 4, 5, 6, 8, 9), $DP->smoothingIndices()); $DP->setEpsilon(1); $DP->runSmoothing(); $this->assertEquals(array(0, 6, 4, 10, 0), $DP->smoothedData()); $this->assertEquals(array(0, 3, 6, 8, 9), $DP->smoothingIndices()); $DP->setEpsilon(2); $DP->runSmoothing(); $this->assertEquals(array(0, 6, 10, 0), $DP->smoothedData()); $this->assertEquals(array(0, 3, 8, 9), $DP->smoothingIndices()); }