App-GUI-Cellgraph
view release on metacpan or search on metacpan
Please mind the tool tips - short help texts which appear if the mouse
stands still over a button. Also helpful are messages in the status bar
at the bottom that appear while browsing the menu of after a command
given.
General Settings
The first tab contains settings, that shape the drawing in the most
broad way. It is segmented into three parts that somewhat parallel the
last three tabs.
The topmost section sets the framework for rules by which the cell state
changes - computation round by computation round. Input Size appoints
the size of neighbourhood, the left side of an subrule. If you set it to
an odd number like 5, then the cells current state plus its two
neighbours on each side determine the next state of a cell. But if you
set it to an even number like 2 then only one neighbour on each side has
this power, but not the focal cell itself. You can recognize this by the
struck through middle cell in each subrule in the "*State Rules*" tab.
Cell States sets the number of different cell states / colors. The
Select option defines an subrule mapping - meaning: how many of the
possible subrule results you can define manually? This aimes to solve
operation modulo cell state count will become the new state. Two options
contain the suffix _rot which means an additional one wil be added so
you rotate through the states even if all subrules are not set and
blank. Cells on the left and right edge normally have only a reduced
amount of neighbours. During computation the virtual left neighbour of
the left most cell has always the state zero. But if you activate the
option Circular, then the left neighbour of the leftmost cell is the
rightmost cell and vice versa. This can fix certain types of
irregularities in the drawing.
The middle section sets the framework for the action rules, which change
the activity value of a cell. The activity value can never be below zero
or above one. The Apply option activates the aplication of action rules.
And if action rules are in effect then the state of a cell can only
change, if the activity value is equal or above the Threshold. Action
rules react to the same input pattern as state rules. However, the
result of an action subrule is the increase of the activity value by an
amount that is different for any subrule that can have its own result
state. This amount of increase is usually but doesn't have to be
positive. There is also another amount which is usually negative and
which decreases the activity value of all cells each round. This
lib/App/GUI/Cellgraph.pm view on Meta::CPAN
use Wx;
use utf8;
our $NAME = __PACKAGE__;
our $VERSION = '0.82';
use base qw/Wx::App/;
use App::GUI::Cellgraph::Frame;
sub OnInit {
my $app = shift;
my $frame = App::GUI::Cellgraph::Frame->new( undef, 'Cellgraph '.$VERSION);
$frame->Show(1);
$frame->CenterOnScreen();
$app->SetTopWindow($frame);
1;
}
sub OnQuit { my( $self, $event ) = @_; $self->Close( 1 ); }
sub OnExit { my $app = shift; 1; }
1;
__END__
lib/App/GUI/Cellgraph.pm view on Meta::CPAN
=head2 General Settings
=for HTML <p>
<img src="https://raw.githubusercontent.com/lichtkind/App-GUI-Cellgraph/main/example/POD/GUIglobal7.png" alt="" width="85%" height="85%">
</p>
The first tab contains settings, that shape the drawing in the most broad way.
It is segmented into three parts that somewhat parallel the last three tabs.
The topmost section sets the framework for rules by which the cell state
changes - computation round by computation round. B<Input Size> appoints
the size of neighbourhood, the left side of an subrule. If you set it to
an odd number like 5, then the cells current state plus its two neighbours
on each side determine the next state of a cell. But if you set it to an
even number like 2 then only one neighbour on each side has this power,
but not the focal cell itself. You can recognize this by the struck through
middle cell in each subrule in the "I<State Rules>" tab. B<Cell States>
sets the number of different cell states / colors. The B<Select> option
defines an subrule mapping - meaning: how many of the possible subrule
results you can define manually? This aimes to solve the none trivial
lib/App/GUI/Cellgraph.pm view on Meta::CPAN
the new state. Two options contain the suffix _rot which means an
additional one wil be added so you rotate through the states even if
all subrules are not set and blank. Cells on the left and right edge
normally have only a reduced amount of neighbours. During computation
the virtual left neighbour of the left most cell has always the state zero.
But if you activate the option B<Circular>, then the left neighbour of
the leftmost cell is the rightmost cell and vice versa. This can fix
certain types of irregularities in the drawing.
The middle section sets the framework for the action rules, which change
the activity value of a cell. The activity value can never be below zero
or above one. The B<Apply> option activates the aplication of action rules.
And if action rules are in effect then the state of a cell can only change,
if the activity value is equal or above the B<Threshold>. Action rules
react to the same input pattern as state rules. However, the result of
an action subrule is the increase of the activity value by an amount
that is different for any subrule that can have its own result state.
This amount of increase is usually but doesn't have to be positive.
There is also another amount which is usually negative and which decreases
the activity value of all cells each round. This decrease value is labeled
lib/App/GUI/Cellgraph/Frame/Panel/ColorPicker.pm view on Meta::CPAN
package App::GUI::Cellgraph::Frame::Panel::ColorPicker;
use base qw/Wx::Panel/;
use App::GUI::Cellgraph::Widget::ColorDisplay;
sub new {
my ( $class, $parent, $colors ) = @_;
return unless ref $parent and ref $colors eq 'HASH';
my $self = $class->SUPER::new( $parent, -1 );
$self->{'colors'} = { %$colors }; # $frame->{'config'}->get_value('color')
$self->{'color_names'} = [ sort keys %{$self->{'colors'}} ];
$self->{'color_index'} = 0;
my $btnw = 46; my $btnh = 17;# button width and height
$self->{'select'} = Wx::ComboBox->new( $self, -1, $self->current_color_name, [-1,-1], [170, -1], $self->{'color_names'});
$self->{'<'} = Wx::Button->new( $self, -1, '<', [-1,-1], [ 30, 17] );
$self->{'>'} = Wx::Button->new( $self, -1, '>', [-1,-1], [ 30, 17] );
$self->{'load'} = Wx::Button->new( $self, -1, 'Load', [-1,-1], [$btnw, $btnh] );
$self->{'del'} = Wx::Button->new( $self, -1, 'Del', [-1,-1], [$btnw, $btnh] );
$self->{'save'} = Wx::Button->new( $self, -1, 'Save', [-1,-1], [$btnw, $btnh] );
( run in 0.411 second using v1.01-cache-2.11-cpan-df04353d9ac )