Skip to Content
作って動かすALife ―実装を通した人工生命モデル理論入門
book

作って動かすALife ―実装を通した人工生命モデル理論入門

by 岡 瑞起, 池上 高志, ドミニク チェン, 青木 竜太, 丸山 典宏
July 2018
Intermediate to advanced
224 pages
3h 13m
Japanese
O'Reilly Japan, Inc.
Content preview from 作って動かすALife ―実装を通した人工生命モデル理論入門

付録A本書で使用しているオリジナルライブラリ

本書のサンプルプログラムでは、シミュレーション結果の可視化や、エージェントモデルの環境シミュレーション用の簡易ライブラリを利用しています。ここでは、それらの使い方について説明します。

A.1 Visualizer

alifebook_lib.visualizers内にあるXXXVisualizerクラスは、シミュレーション結果を可視化するためのクラスです。初期化後にupdateメソッドを呼ぶごとに画面が更新されます。

また、アプリケーション実行中はbool(visualizer)はTrueを返しますが、閉じるボタンを押すなどで終了するとFalseを返します。

以下は、典型的な使い方です。

visualizer = Visualizer()

― シミュレーションの初期化処理 ―

while visualizer:

    ― シミュレーションを進める処理 ―

    visualizer.update(simulation_result)

以下に各クラスの初期化パラメータ、updateメソッドの引数、各クラス独自に使えるメソッドの紹介をします。

class ArrayVisualizer(width=600, height=600, history_size=600, value_range_min=0, value_range_max=1)

一次元配列を可視化するためのクラス

updateの引数:
NumPyの一次元配列
初期化パラメータ:
width, height (optional)

表示するウィンドウのサイズ

history_size (optional)

何個前の配列まで画面に表示するか

value_range_min, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

プログラミングRust 第2版

プログラミングRust 第2版

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall, 中田 秀基
仕事ではじめる機械学習 第2版

仕事ではじめる機械学習 第2版

有賀 康顕, 中山 心太, 西林 孝

Publisher Resources

ISBN: 9784873118475Publisher Website