Acme::FishFarm::WaterFiltration - Water Filter for Acme::FishFarm
Version 1.01
use 5.010; use Acme::FishFarm qw( reduce_precision ); use Acme::FishFarm::WaterFiltration; my $water_filter = Acme::FishFarm::WaterFiltration->install; say "Water filter installed and switched on!\n"; my $current_reading; my $waste_count_threshold; while ( "Fish are living under the water..." ) { $water_filter->current_waste_count( reduce_precision ( rand(100) ) ); $current_reading = $water_filter->current_waste_count; $waste_threshold = $water_filter->waste_count_threshold; print "Current Waste Count: ", $current_reading, " (high: >= ", $waste_threshold, ")\n"; if ( $water_filter->is_cylinder_dirty ) { print " !! Filtering cylinder is dirty!\n"; print " Cleaned the filter!\n"; $water_filter->clean_cylinder; } else { print " Filtering cylinder is still clean.\n"; } sleep(1); say ""; }
None
This module assumes a cool water filter with a filtering cylinder constantly filtering water in the tank. It has inlet, outlet and a drainage valves. The drainage valve is only opened when the cleaners are switched on automatically to remove waste from the cylinder. To be honest, those cleaners look more like spatulas to me :)
This feature is based on the water filter found here
Installs a cool water filtration system.
The following are avaiable for %options:
%options
The current waste count in the cylinder. Default is 0.
0
Default value is 75.
75
Sets the waste treshold.
This is the maximum limit of waste in the cylinder. When this count is hit, it will turn on the cleaners / spatulas or whatever it's called :).
Default is 10.
10
The amount of waste to remove from the cylinder / filter each time the cleaning process is called.
Sets / returns the current waste count inside the cylinder.
$new_waste_count is optional. If present, the current waste count will be set to $new_waste_count. Otherwise, returns the current waste count.
$new_waste_count
Returns the waste count threshold.
Sets the waste count threshold.
Returns the amount of waste to be reduce each time the cleaning process is called.
Sets the waste count reduction value to $new_count.
$new_count
Synonym for is_cylinder_dirty. See next method.
is_cylinder_dirty
Returns 1 if the filtering cylinder is dirty ie current waste count hits the waste count threshold. Returns 0 otherwise.
1
Remember to clean your cylinder ie. filter layer as soon as possible if it is dirty.
Cleans the filter layer in the cylinder.
$reduce_waste_by is optional. If present, it will reduce waste by that specific value. Otherwise, it cleans the cylinder completly in one shot ie waste count will be 0.
$reduce_waste_by
If $reduce_waste_by is a negative value, it will be turned into a positive value with the same magnitude.
Make sure that you turn on the spatulas, if not this process will not do anything :) See turn_on_spatulas below.
turn_on_spatulas
Activates the cleaning mechanism ie the spatulas :)
Take note that turning on the spatulas does not clean the cylinder. You need to do it explicitly. See clean_cylinder method above for more info :)
clean_cylinder
Deactivates the cleaning mechanism ie the spatulas :)
Returns 1 if the spatula are turned on. The spatula will not clean the cylinder until you explicitly tell the system to do so. See clean_cylinder method above for more info.
Raphael Jong Jun Jie, <ellednera at cpan.org>
<ellednera at cpan.org>
Please report any bugs or feature requests to bug-. at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=.. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-. at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Acme::FishFarm::WaterFiltration
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=.
CPAN Ratings
https://cpanratings.perl.org/d/.
Search CPAN
https://metacpan.org/release/.
Besiyata d'shmaya
This software is Copyright (c) 2021 by Raphael Jong Jun Jie.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Acme::FishFarm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::FishFarm
CPAN shell
perl -MCPAN -e shell install Acme::FishFarm
For more information on module installation, please visit the detailed CPAN module installation guide.