复杂天下分享 http://blog.sciencenet.cn/u/synchronize

博文

FYI:如何安装muxViz软件?

已有 7896 次阅读 2018-1-9 10:57 |个人分类:软件心得|系统分类:科研笔记

INSTALLATION muxViz SOFTWARE

《如何安装muxViz软件?》


翻译[1]:刘杰(武汉纺织大学非线性科学研究中心)


步骤一:安装muxViz的软件环境准备环节:

Step1.1 下载并安装一个Octave (要求版本号3.4.0及以上),下载地址位于:http://www.gnu.org/software/octave/download.html

Download and install a copy of Octave(3.4.0 or above):
http://www.gnu.org/software/octave/download.html

注意事项1:应通过命令行从任何文件夹访问Octave (, 则必须将其添加到 PATH 环境变量中。

Octave should be accessible through commandline from any folder (i.e., it is mandatory to add it in your PATH environmentvariable).


If you are not familiar with this simple task, you should visit
http://www.java.com/en/download/help/path.xml

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

注意事项2:如果你不会设置环境变量,请按照下面的说明,根据你自己的操作系统选择设置的具体操作。

附录:如何设置环境变量(How do I set or change the PATH systemvariable?

Thisarticle applies to:

Platform(s):Oracle Linux, Red Hat Linux, SUSE Linux, Solaris SPARC, Windows7, Windows 8, Windows Vista, Windows XP, Mac OS X

Theinstructions on this page are intended for advanced users or system administrators.

General Information

  • The PATH is the system variable that your     operating system uses to locate needed executables from the command line     or Terminal window.

  • The PATH system variable can be set using System     Utility in control panel on Windows, or in your shell's startup file     on Linux and Solaris.

  • Making changes to the system PATH variable is typically not necessary     for computers running Windows     or Mac OS X.


Windows

Windows 10 and Windows 8

1.      In Search, search for and then select: System (Control Panel)

2.      Click the Advancedsystem settings link.

3.      Click EnvironmentVariables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.

4.      In the EditSystem Variable (or NewSystem Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows byclicking OK.

5.      Reopen Command prompt window, and run your java code.

Windows 7

1.      From the desktop, right click the Computer icon.

2.      Choose Propertiesfrom the context menu.

3.      Click the Advancedsystem settings link.

4.      Click EnvironmentVariables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.

5.      In the EditSystem Variable (or NewSystem Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows byclicking OK.

6.      Reopen Command prompt window, and run your java code.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

附录:Win10 64位系统中如何设置环境变量的图示说明:

首先,右键“此电脑”,点击“属性”按钮;


其次,选择“高级系统设置”选项卡,

再次,选择“环境变量”按钮;

在弹出的界面中,在系统变量选项卡中,选择“新建”按钮,弹出以下对话框:

在其中填入:

变量名:Octave

变量值:(通过浏览目录的方式找到Octave的安装地址目录即可!)

下图是填好的状态:

点击确定、确定、确定,大功告成!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Step1.2 下载并安装一个RmuxViz软件需要R软件(要求版本号3.0.2及以上),下载地址位于:http://www.r-project.org/

muxViz requires R v3.0.2 (or above). Download and installa copy of R from
http://www.r-project.org/

在此下载页面选择downloadR,系统会弹出一个页面让你选择下载镜像:

选择中国兰州镜像下载,一直速度比较正常。

在此页面,根据你的操作系统选择合适的高版本下载安装即可。我们选择的是windows系统版本。安装时只需要选择64R即可。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

注意:在 R 环境中,muxViz软件需要一些外部软件包。但是, 主脚本muxVizGUI.R应该能够自动检测丢失的包并自动安装它们。因此, 您可能不需要自己安装它们。

Some external packages are required within the R environment. However, themain script should be able to detect the missing packages and install them,automatically. Therefore, it is likely that you do not need to install them byyourself.

注意:有些同学有完美价值取向,总希望把所有可能的R包都安好在机器上以备不时之需!在此,我需要提醒一下您的是,更新安装所有的包“一没必要、二是会耗时很长很长(估计一天都装不完,别问我为什么,说起来都是泪,我自己就这样干过,一天都没装完……)”我的工作机是最新的DELL7910塔式工作站,内存、cpu什么的都是顶配,也得安装longlong time!!!最后还是放弃了!!!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Step1.3 下载muxViz包,将它放到R的当前工作目录下。一般在此电脑\文档文件夹\R文件夹内。

读者可以在Github下载muxViz项目文件,该压缩包文件的下载地址是:https://github.com/manlius/muxViz/archive/master.zip

You can download muxViz from Github: https://github.com/manlius/muxViz/archive/master.zip

为了与地理网络正常工作, GDAL库 (地理空间数据抽象库) 是必需的, 应该在第一次运行 muxViz 之前安装。GDAL 应该是一个 R 包, 应该很容易安装,在R环境下只需键入两行命令即可:

install.packages("sp")
install.packages("rgdal")

To work properly with geographical networks,the GDAL (Geospatial Data Abstraction Library) is required and should beinstalled before running muxViz for the first time. GDAL should be available asan R package and should be easily installed just by typing two command lineswithin the R environment.

install.packages("sp")
install.packages("rgdal")

然而, 在少数情况下, 它可能会更加复杂, 并且一些用户报告了它的安装问题。(译者说明:但我并没有遇到额外的问题。)如果这也是你的情况下, 你可能想看看一些建议 stackoverflow (读 stackoverflow) 或在这个博客上 (spatial.ly)。在任何情况下, 强烈建议访问 GDAL 网站, 并按照提供的提示处理 (前往 GDAL 官方网站)。

However, in a few cases it can be morecomplicated and some users reported problems for its installation. If this isalso your case you might want to take a look at some suggestions onstackoverflow (Read onstackoverflow) or on this blog (Read on spatial.ly). In any case, it is highly recommend tovisit the GDAL website and follow the hints provided there (go to GDAL official website).

步骤二:使用muxViz的软件

Step2.1打开R

点击文件下拉菜单,选择改变工作目录选项卡;

在跳出来的浏览文件夹窗口,浏览到muxViz-master文件夹,点击确定按钮完成当前工作目录的更改。

回到RGui窗口,点击“文件”选项卡,选择“运行R脚本文件…”;

选择本软件包的核心文件:muxVizGUI.R,程序会开始工作(运行>source("C:\\Users\\dell\\Documents\\R\\muxViz-master\\muxVizGUI.R")),选择适当的更新软件包的镜像服务器后,它会自动载入muxVizGUI.R需要的相关软件包。

于是你会看到R命令窗口出现如下欢迎信息:

同时, muxViz的网络在线操作界面会跳出来:

现在开始使用探索吧!!!

注意:软件GUI界面的地址栏的127.0.0.1是回送地址,指本地机,一般用来测试使用。回送地址(127.x.x.x)是本机回送地址(Loopback Address),即主机IP堆栈内部的IP地址,主要用于网络软件测试以及本地机进程间通信,无论什么程序,一旦使用回送地址发送数据,协议软件立即返回,不进行任何网络传输。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

步骤三:其他环境下安装和使用muxViz的软件

Very quick installation on Linux

If you use a Linux (Ubuntu-like)distribution, you are very lucky, because the following BASH script will do thejob for you.

Before installing muxViz be sure that you have the gcc suite installed. If youare not sure, do:

sudo apt-get g++
sudo apt-get gfortran

and then you can proceed with installationof R and Octave:

#download Octave and R from theirrepository
wget http://ftp.gnu.org/gnu/octave/octave-3.6.0.tar.gz
wget http://cran.es.r-project.org/src/base/R-3/R-3.2.0.tar.gz
DIR=$PWD

#install Octave
sudo apt-get build-dep octave
sudo mv octave-3.6.0.tar.gz ~
cd ~
tar xvf octave-3.6.0.tar.gz
cd octave-3.6.0
./configure
make
sudo make install
cd $DIR

#install R
sudo apt-get build-dep r-base-core
sudo mv R-3.2.0.tar.gz ~
cd ~
tar xvf R-3.2.0.tar.gz
cd R-3.2.0
./configure
make
sudo make install

#install GDAL
sudo apt-get install libgdal1-dev libproj-dev

Finally, if your system has a workinginstallation of Octave, R and GDAL, you can download the last version ofmuxViz, unzip it and type the following within R environment:

source('muxVizGUI.R')

This should be enough. The script willcheck for the required packages and will try to automatically install themissing ones. The whole process might take a few minutes, the first time yourun muxViz.

Troubleshooting

Please, if you have any problem during theinstallation of muxViz, visit the dedicated Google Group or check the TROUBLESHOOTING.md filebefore asking for help: you might find the solution faster.

If you find a smart solution to aninstallation/usage issue, feel free to send me an email and I will add yoursolution to the TROUBLESHOOTING.md file.

如何使用(USAGE)?

输入文件的格式说明(Format of an input file

配置文件(configuration file)是一个 ASCII 文件, 包括要包含在多层网络中的层列表、相应的标签和可能的布局文件来定义节点属性 (例如、标识、标签、地理坐标等)。

The configuration file is a ASCII fileincluding the list of layers to be included in a multiplex, the correspondinglabels and the possible layout file to define node properties (e.g., ID,labels, geographic coordinates, etc).

配置文件的格式如下:

Format of a configuration file:

path_layer_X; label_layer_X; layout_layer_X

其中,where:

  • path_layer_X: [mandatory] specify the path and the filename to the     edges list to be used as layer【强制性参数】为作为一层网络的边列表指定其路径和文件名。

  • label_layer_X: [optional] specify the label to be used in the     rendering for that layer【可选参数】为使该层成为网络指定标签。

  • layout_layer_X: [optional] specify the path and the filename to the     file containing information about nodes【可选参数】为包含节点信息的文件指定路径和文件名。

配置文件中的每一行象征、代表着着一层网络,每层网络格式应该是“标准的边列表”。

Each line in the configuration fileindicates one layer, and the network format for each layer will be"standard edges list" (see below).

Non-edge-colored networks

如果多层网络不是连边着色的(比如允许内部连线),仅仅有一根线在配置文件中被指定,一般具有如下格式:If the multilayer is not edge-colored(i.e., inter-links are allowed), only one line is specified in theconfiguration file, with format:

path_multilayer; path_to_layers_info; path_to_layers_layout

其中:where:

  • path_multilayer: [mandatory] specify the path and the filename to the     extended edges list to be used【强制性参数】为拟采用的扩展边列表指定其路径和文件名。

  • path_to_layers_info: [mandatory] specify the path and the filename to     the file containing information about layers【强制性参数】为包含层信息的文件指定其路径和文件名。

  • path_to_layers_layout: [mandatory] specify the path and the filename     to the file containing information about nodes【强制性参数】为包含节点信息的文件指定其路径和文件名。

在此情形下,网络格式通常为“extended edges list”(参见下文示例)。In this case the network format will be"extended edges list" (see below).

标准边列表:(Standard edges list

典型的边列表是至多含有三列的一个文件:给出了边的列表信息,即从第一列代表的头节点到第二列代表的尾节点,第三列则是可能的权重信息。A typical edges list isexpected to be a file with at most three columns, giving the list of edges froma node (first column) to other nodes (second column), possibly weighted by aninteger or floating number (third column).

例如:For instance:

1 2 0.5

1 3 1.4

...

18 124 0.1

就是典型的赋权边列表文件格式。

is a typical weighted edges list.

通常,节点的ID应该由按顺序的自然数表示,可以从0或者1开始计数,直到网络节点总数值。IDs of nodes are expected to be sequentialintegers (starting from 0 or 1, up to the number of nodes in the network).

然而,也可以导入标签列表(可以是任意整数或者字符串)。此时,研究者需要在导入网络前检视适当的盒子以确保muxViz能解释这一格式。Nevertheless, it is possible to importlabel-based edges list, where the IDs of nodes are labels (arbitrary integersor strings): in this case, one should check the appropriate box beforeimporting the networks, to let muxViz know how to interpret the format.

边列表可以看起来像如下形式:

The edges list could look like:

alice bob 0.5
alice charlie 1.4
...
john david 0.1

在此情形下,系统强制需要提供一个布局文件(下一小节会提及)来报告按顺序排列的节点ID信息(就是nodeID域)用于指定每一个节点的节点标签(就是nodeLabel域)。In this specific case, it is mandatory toprovide a layout file (see next section) reporting the sequential node ID(field nodeID) to be assigned to each node label (field nodeLabel).

这看起来就像下面的实例:This would look like:

nodeID nodeLabel
1 alice
2 bob
3 john
4 david
...

扩展边列表(Extended edges list

扩展的边列表是允许指定联系所有可能类型(如层间或者层内类型联系)的一类新的格式。An extended edges list is a new formatthat allows to specify all possible types of links, intra- and inter-layer.

每一行会在第一列指定一个源节点、第二列指定该源节点所在层、第三列为目标节点、第四列为目标节点所在层,而在第五列则可以指定连边的权重,全职可以是整数或者是小数。

Each line specifies the source node (firstcolumn) and the source layer (second column), the destination node (thirdcolumn) and the destination layer (fourth column), possibly weighted by aninteger or floating number (fifth column).

例如:For instance:

1 1 2 1 0.5
1 1 3 1 1.4
...
18 2 124 2 0.1

就是一个典型的赋权扩展的边列表文件。

is a typical weighted extended edges list.

对于有标签的扩展边列表,可以用前面提到的标准边列表增加标签的规则进行处理,限于篇幅在此不再赘述。

For label-based extended edges lists, thesame rules of the standard edges lists apply

布局文件格式(Format of a layout file

文件的第一行必须指定相应节点属性的名称。允许的属性包括:

The first line of the file must specifythe name of the corresponding node attributes. Allowed attributes:

  • nodeID: [mandatory] numerical integer id to identify each node

  • nodeLabel: [optional] string specifying the label attribute

  • nodeX: [optional] float value specifying the Cartesian coordinate x     for the layout

  • nodeY: [optional] float value specifying the Cartesian coordinate x     for the layout

  • nodeLat: [optional] float value specifying the latitude for the     geographic layout

  • nodeLong: [optional] float value specifying the longitude for the     geographic layout

列的顺序不应该是相关的。

The order of the columns should not berelevant.

如果指定了nodeLat 和 nodeLong, 它们将自动转换为笛卡尔坐标 (通过墨卡托投影)。必须指定多层中每个节点的属性, 否则将使用默认值 (即, 自动标记和布局)。如果网络中的节点数与布局文件中提供的节点数不同, 则会假定布局文件有问题, 并且将使用默认值。

If nodeLat and nodeLong are specified,they will be automatically converted to Cartesian coordinates (through Mercatorprojection). The properties of each node in the multilayer must be specified ordefault values will be used (i.e., automatic labeling and layouting). If thenumber of nodes in the network is different from the number of nodes providedin the layout file, it will be assumed that something is wrong with the layoutfile and default values will be used.

层信息文件格式(Format of a layer-info file

文件的第一行必须指定相关的层属性名称。允许的属性包括:

The first line of the file must specifythe name of the correponding layer attributes. Allowed attributes:

  • layerID: [mandatory] numerical integer id to identify each layer

  • layerLabel: [optional] string specifying the label attribute

列的顺序不应该是相关的。

The order of the columns should not be relevant.

时间轴文件格式(Format of a timeline file

这个模块允许在多层网络的顶部建立与动态过程相对应的好的动画可视化。例如, 你可以可视化一个 (或更多) 随机行走的个体在网络中的运动, 或在社会网络中流行病传播的模因, 或者可视化在交通/通信网络中的交通状况 (和可能的拥塞)等。

This module allows to build nice animatedvisualizations corresponding to dynamical processes on the top of a multilayernetwork. For instance, one can visualize the movements of one (or more) randomwalker(s) in the network, or the spreading of an epidemics or of a meme in asocial network, the traffic (and possible congestions) in atransport/communication network, etc.

这一设计的目的是为模块提供一个 "时间轴" 文件,以便在每个时步中指定该多层网络中节点和边的状态变化。对象的 "状态" 可以通过改变它的颜色和/或它的大小来改变。例如,在流行病在一个国家传播的场景下, 每个节点的大小 (例如, 描述城市的种群) 可以与人口成正比, 颜色可以编码受感染者的数量信息。这种描述方式使得各种各样的动力学被表征并且被可视化呈现: 例如, 必要时设置节点和边缘的大小为零就可以表达多层网络节点和便随时间出现或者消失。

The idea is to feed the module with a'timeline' file where the change of the state of nodes and edges in themultilayer network are specified at each time step. The 'state' of an objectcan be altered by changing its color and/or its size. For instance, in the caseof an epidemics spreading in a country, the size of each node (e.g., ametapopulation describing a city) can be proportional to the population and thecolor can encode the amount of infected people. This description allows a widevariety of dynamics to be represented and visualized: for instance, setting thesize of nodes and edges to zero when required, it is possible to visualize atime-varying multilayer network where nodes and edges appear or disappear overtime.

文件的第一行必须指定相关的时间线属性的名称。允许的属性包括以下参数:

The first line of the file must specifythe name of the correponding timeline attributes. Allowed attributes:

  • timeStep: [mandatory] numerical integer id to identify time steps

  • labelStep: [mandatory] string specifying the snapshot label

  • entity: [mandatory] string specifying if the object to modify is 'node' or     'edge'

  • layerID: [mandatory] numerical integer id to identify each layer

  • nodeID: [mandatory] numerical integer id if entity is 'node' and string     (e.g., '3-7', corresponding to the link from node 3 to node 7) if entity     is 'edge'.

  • color:     [mandatory] string specifying the color to be assigned

  • sizeFactor: [mandatory] float value specifying the relative size of the entity,     scaling with respect to the default size

列的顺序不相关。如果网络具有 L 层, 并且您希望在可视化中包括聚合网络, 则在 layerID 字段中使用L+1。

The order of the columns is not relevant.If the network has L layers and you want to include the aggregate network inthe visualization, then use L+1 in the layerID field for it.

为了让用户有自由使用自己喜爱的视频制作软件, muxViz 的输出由代表动态的时间快照的 png 文件组成。快照保存在'export/timeline/project_name'文件夹中。用户可以使用自己喜欢的软件将快照序列合并到单个视频中。我们建议使用FFmpeg 与以下参数:

ffmpeg -r 1 -i /path/xyz_%05d.png -c:vlibx264 -pix_fmt yuv420p -r 25 output_file.mp4

To keep users with the freedom to usetheir favorite video making software, the output of muxViz consists of pngfiles representing the temporal snapshots of the dynamics. Snapshots are savedin the folder 'export/timeline/project_name'. Successively, users can use theirfavorite software to merge the sequence of snapshots into a single video. Werecommend to use FFmpeg with the following parameters:

ffmpeg -r 1 -i /path/xyz_%05d.png -c:vlibx264 -pix_fmt yuv420p -r 25 output_file.mp4

OTHER SCRIPTS INCLUDED

其他脚本函数简介:

muxViz v0.1 (CLI)

Usage from shell command line (no supportto GUI and no longer developed):

R CMD BATCH muxViz.R

If used with the default options for thefirst time, muxViz will plot a multiplex with 100 nodes and 4 layers withcommunity-like topology. The output should be a file 'muxViz.png' in the samefolder, similar to 'muxViz_example.png' provided with the package.

Please, explicitly cite muxViz if you findit useful for your visualizations.

If you use muxVizGUI for your dataanalysis, please, cite the relevant papers where all descriptors anddiagnostics are defined: you will find a quick help with references to relevantpapers in all pages dedicated to data analysis.

monoxViz v0.1 (CLI)

Support the visualization of classicalsingle-layer networks (no longer developed).

The muxViz package now includes a scriptfor the visualization of standard networks. It supports both 2D and 3Dlayouting with openGL, it is fully integrated with OpenStreetMap and preservesall the features developed to customize visualizations with muxViz.

视频指南(VIDEO TUTORIAL

muxViz Tutorials: Learning muxViz in 10 minutes

muxViz Tutorials: Visualization of Multilayer Networks

muxViz Tutorials: Visualization of Geographic MultilayerNetworks

muxViz Tutorials: Multilayer Centrality Analysis

Please, note that voice commenting thesteps is still missing. We are working about that.



[1]根据自己安装使用经验增补了一些技术细节,本文操作基于win10 64位操作系统进行。




https://blog.sciencenet.cn/blog-37313-1093887.html

上一篇:备忘:初学者安装完MuxViz运行时一个常见报错的处理方法!
下一篇:FYI:推荐微信公众订阅号 NonlinearScience !
收藏 IP: 117.152.76.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-27 23:49

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部