【deepcoder个人笔记】日常的学习集合

mac
交通
机器学习

#1

布雷斯悖论简介

一、什么是布雷斯悖论

韩国首尔曾经拆毁了一条有6条车道的高速路,改建成了一个公园,然而人们在交通上耽误的时间不仅没有因此而增加,反而减少了。这种反常的现象最先由布雷斯发现并研究。布雷斯是德国波鸿鲁尔大学的数学家,二十世纪六十年代晚期,在一次寻找交通流的最佳解决方案时,他得出了一个惊人的发现:即简单的在公路网络上增加一条线路,反而会增加整体的运行时间。这个现象被称为布雷斯悖论。

维基百科介绍:

为了更清楚的观察布雷斯悖论,我们来观察如下运输网络:

image

节点代表高速路的出入口,边代表高速路,边上的权值表示走着一条高速路所需要的时间代价。这个代价可能是固定的,如A到D的高速路需要45min走完;当然也有可能是变化的,如A到C的高速路的时间根据车流量(x表示道路上的车辆数)的变化呈现出正比例的函数关系。现在,有4000辆车需要从A到B,那么他们将会怎么选择道路呢?

他们最终的选择将会是:其中2000辆车走经过C的路径,另外2000辆车将会走另一条路径。因为在这种分配模式下,没有一辆车可以通过更换路径的方式得到更大的好处。也就是说,没有人会因为改变而尝到甜头。从博弈论的角度上去描述,这些车辆的在选择路径的问题上已经达成了纳什均衡。

现在,如果我们建设一条从C到D的单向车道,这条车道的时间花费为0。那么每辆车的选择会有什么变化,反映到时间上会怎样?

image

司机们会选择先到C,然后走新建的道路到D,最后到B。道理和之前一样,每个司机都凭借着自己的理性选择了最省时的路径,然而他们花费的时间从原来的65分钟增加到了80分钟。

布雷斯悖论其实并不像说谎者悖论那样,产生逻辑上的矛盾。它被称之为悖论是因为实际情况与我们的直觉(通常人们会认为增加道路有助于缩短出行时间,至少不应该增加)相反。这说明了,博弈的方式虽然表面上为个体争取了最大的利益,然而个体之间的行为缺乏统一协调所带来的劣势可能会随着竞争面的扩大而更加凸显。


#2

大脑为什么觉得不公平

两千多年前,孔子就洞察了人们“不患寡,患不均”的心态。两千多年后,我们仍然致力于解决和解释公平(fairness)这个问题。为了解决社会公平问题,联合国开大会,确定每年的2月20日为世界社会公正日。那么,科学家们又如何解释这一现象呢?

1 . 心理学角度

1965年左右,美国心理学家约翰·斯塔希·亚当斯(John Stacey Adams)提出了“公平理论”。他先后写了有关公平的一系列学术著作,并提出了管理心理学和社会心理学中的经典观点:“员工的激励程度,来源于对自己和参照对象的报酬、投入比例的主观比较感觉” 。

通俗地说就是,员工想不想好好干活,不但取决于老板给了多少钱,还取决于跟其他同事的工资高低,工作努力程度,进行比较以后的心理状态。这个理论是不是看上去,太通俗易懂,显得不够学术范呐。但是,对当管理者们的启发意义重大,是心理学和经济学相关领域,员工激励问题的经典观点之一。

我们来看一个最真实,也最为有趣的动物实验研究吧,最好地诠释这个理论:

2 . 遭遇不公平对待,卷尾猴“萌萌”地怒了

2003年发表在《自然》杂志上的一篇研究中,美国埃默里大学(Emory University)的弗兰斯·德·瓦尔教授,通过巧妙设计实验,观察到了一种主要生活在南美洲的卷尾猴(又称僧帽猴,Tufted Capuchin),拒绝人类为它的“劳动”支付不公平的报酬。

实验过程是这样的:实验员先训练两只猴子,把笼子里面的石头“货币”交还给实验员,就可以得到一些食物的奖励。当每只猴子单独完成“任务”时,给它们黄瓜片,它们一般都会接受。但是,如果一只猴子看到同伴得到的是葡萄,而自己得到的是黄瓜片时,它就可能会“萌萌地”怒了。行为表现是,把黄瓜片丢回实验员,对着笼子壁一阵抓狂,还很有可能会拒绝继续交换。

图一 棕卷尾猴(brown capuchin monkey,拉丁语名 Cebus apella)

作者说,在包括大猩猩、狗和一些鸟类中,也发现了类似的对公平的感受。由此我们可以推测,对于公平的感知,是动物在进化过程,普遍可以获得的一项本能,并非人类所独有的,不是由单纯的文化因素导致。

那么人类对于公平的感受,是从人生中什么时候开始的呢?让我们看一下相关的结果,结论可能会让你吃惊:

3 . 人类婴儿会关注到不公平现象

意大利的科学家观察了10个月左右大小的婴儿对于不公平现象的反应。婴儿会分别看到两段小动画(见下图),上面的动画中,蓝色方块会把两颗草莓,公平地分配给两个绿色五角星。而下面一段视频中,黄色三角会把两颗草莓都给其中一个绿色五角星。研究者用眼动追踪摄像机,追踪了儿童观在看视频过程中,目光注视位置的变化。实验结果是,婴儿会花更多时间去关注做出不公正分配的角色。

图二 电脑模拟的分配不公平实验

大量心理学的实验,重复验证了这个结论。另外一个研究中,上面实验中的卡通图标,换成了真实的人来演示,婴儿为15,19个月和21个月左右,他们也更倾向于关注“不公平”情况的出现。当婴儿长到三到四岁的时候,他们就能够在实际进行糖果分配的时候,把糖果与其他小朋友平分。当然,不是每次都这样。而到了五岁的时候,他们进行平分的可能性就更大,表现出的公平倾向也越稳定。

那么,在我们成人的大脑中,究竟有哪些区域是负责公平和正义的呢。

4 . 感知“不公平”的脑区

功能性核磁共振(fMRI)是利用大脑局部区域血氧消耗量(Bold)来估测脑区大范围神经元活动的一种技术。通俗了讲,就是一种实时扫描脑内不同区域活跃状态的方法。通过比较大脑处理“公平”相关信息时,和平时(静息)状态下,哪些脑区活跃状态不同,就可以发现哪些脑区参加了对公平的感知。

目前的研究结果是,已经有多篇相关文献,发现包括前额叶皮层(prefrontal cortex)、 颞上沟区(superior temporal sulcus region,STS)、杏仁核(Amygdala)、 脑岛(insula)等脑区都参加到了对公平的判断和反应。

image

图三 大脑内的与公平和惩罚抉择相关的脑区

大脑皮层的前额叶部分,负责短期/工作记忆(short term/working memory)存储,决策制定(decicion making),对情景和记忆的比较,以及对情绪的控制等功能。颞上沟区是高级视觉皮层,参与物体和人脸识别。杏仁核和脑岛都是脑内边缘系统(Limbic System)的一部分,杏仁核主要跟负面情绪、恐惧记忆等相关,脑岛除了参与情绪和相关记忆,还负责了奖励等相关信息的处理。

由此我们可以看出,这些脑区具备了:识别出到一次不公平行为的参与者与物品(颞上沟区域)——对情景和旧的记忆进行比较(前额叶部分)——判定不公平情形出现(前额叶部分)——产生或调动奖惩相关负面情绪记忆(杏仁核与脑岛)等一系列功能。

相关TED演讲视频:


#3

Homebrew简介和基本使用

一、Homebrew是什么

  • Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。

  • Homebrew – OS X 不可或缺的套件管理器。

二、Homebrew安装

1. 要求

  • Intel CPU 1

  • OS X 10.9 or higher 2

  • Xcode命令行工具 3

     $ xcode-select --install
    
  • 支持shell (sh或者bash) 4

2. 安装和卸载

  • 安装

     /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  • 卸载

     1 $ cd `brew --prefix`
     2 $ rm -rf Cellar
     3 $ brew prune
     4 $ rm `git ls-files`
     5 $ rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
     6 $ rm -rf .git
     7 $ rm -rf ~/Library/Caches/Homebrew
    

三、Homebrew基本使用

  • 安装任意包

     $ brew install <packageName>
    

    示例:安装wget

     $ brew install wget
    
  • 卸载任意包

     $ brew uninstall <packageName>
    

    示例:卸载git

     $ brew uninstall git
    
  • 查询可用包

     $ brew search <packageName>
    
  • 查看已安装包列表

     $ brew list
    
  • 查看任意包信息

     $ brew info <packageName>
    
  • 更新Homebrew

     $ brew update
    
  • 查看Homebrew版本

     $ brew -v
    
  • Homebrew帮助信息

     $ brew -h
    

输出示例:

 1 Example usage:
 2   brew search [TEXT|/REGEX/]
 3   brew (info|home|options) [FORMULA...]
 4   brew install FORMULA...
 5   brew update
 6   brew upgrade [FORMULA...]
 7   brew uninstall FORMULA...
 8   brew list [FORMULA...]
 9 
10 Troubleshooting:
11   brew config
12   brew doctor
13   brew install -vd FORMULA
14 
15 Brewing:
16   brew create [URL [--no-fetch]]
17   brew edit [FORMULA...]
18   https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md
19 
20 Further help:
21   man brew
22   brew help [COMMAND]
23   brew home

四、注意

  • 在Mac OS X 10.11系统以后,/usr/local/等系统目录下的文件读写是需要系统root权限的,以往的Homebrew安装如果没有指定安装路径,会默认安装在这些需要系统root用户读写权限的目录下,导致有些指令需要添加sudo前缀来执行,比如升级Homebrew需要:

     $ sudo brew update
    
  • 如果你不想每次都使用sudo指令,你有两种方法可以选择:

  1. 对/usr/local 目录下的文件读写进行root用户授权

       $ sudo chown -R $USER /usr/local
    

    示例:

     $ sudo chown -R wentianen /usr/local
    

    2.(推荐)安装Homebrew时对安装路径进行指定,直接安装在不需要系统root用户授权就可以自由读写的目录下

     <install path> -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

参考

  • Homebrew官方推荐使用教程
  • 安装卸载homebrew
  • 官方源码库

注解

  • 官方说明并非所有的指令具有CPU或操作系统要求,假如不符合系统要求,猜测会遇到问题。此外,你可以查看:Interesting Taps & Branches。
  • 官方推荐系统版本为10.9或更高。10.5 - 10.8官方会尽力支持。对于10.4和10.5,见 Tigerbrew。
  • 大多数命令需要一个编译器。少数需要安装一个完整的Xcode。你可以安装Xcode,或者CLT,或两者兼而有之; Homebrew支持三种配置。在旧版操作系统中下载Xcode可能需要苹果开发者账号,你可以在这里免费注册。
  • 单行安装方法可以查看brew.sh,但是需要兼容shell(如bash或zsh中)。需要注意的是,fish、tcsh、csh会无法使用。

#4

mac下的Graphviz安装及使用

买了mac后,发现原来graphviz在mac上使用这么方便!

Graphviz官网

一. 安装

mac用户建议直接用homebrew来安装

    1. 安装homebrew

    打开终端复制、粘贴以下命令:

     ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    
  • 2.安装Graphviz

    homebrew安装完毕后运行 brew install graphviz即可

二.使用

  • 例子1:

    1. 使用文本编辑器(mac上我使用sublime )输入以下内容:
     digraph pic { 
       Hello -> World
     }
    
  1. 保存为pic.dot文件

  2. 打开终端,切换到dot文件所在目录,输入dot pic.dot -T png -o pic.png

  3. 可以看到在dot文件目录下生成了一个pic.png文件

  • 生成的图片:

    20171013133022687

  • 例子2:

digraph "unix" {
	graph [	fontname = "Helvetica-Oblique",
		fontsize = 36,
		label = "\n\n\n\nObject Oriented Graphs\nStephen North, 3/19/93",
		size = "6,6" ];
	node [	shape = polygon,
		sides = 4,
		distortion = "0.0",
		orientation = "0.0",
		skew = "0.0",
		color = white,
		style = filled,
		fontname = "Helvetica-Outline" ];
	"5th Edition" [sides=9, distortion="0.936354", orientation=28, skew="-0.126818", color=salmon2];
	"6th Edition" [sides=5, distortion="0.238792", orientation=11, skew="0.995935", color=deepskyblue];
	"PWB 1.0" [sides=8, distortion="0.019636", orientation=79, skew="-0.440424", color=goldenrod2];
	LSX [sides=9, distortion="-0.698271", orientation=22, skew="-0.195492", color=burlywood2];
	"1 BSD" [sides=7, distortion="0.265084", orientation=26, skew="0.403659", color=gold1];
	"Mini Unix" [distortion="0.039386", orientation=2, skew="-0.461120", color=greenyellow];
	Wollongong [sides=5, distortion="0.228564", orientation=63, skew="-0.062846", color=darkseagreen];
	Interdata [distortion="0.624013", orientation=56, skew="0.101396", color=dodgerblue1];
	"Unix/TS 3.0" [sides=8, distortion="0.731383", orientation=43, skew="-0.824612", color=thistle2];
	"PWB 2.0" [sides=6, distortion="0.592100", orientation=34, skew="-0.719269", color=darkolivegreen3];
	"7th Edition" [sides=10, distortion="0.298417", orientation=65, skew="0.310367", color=chocolate];
	"8th Edition" [distortion="-0.997093", orientation=50, skew="-0.061117", color=turquoise3];
	"32V" [sides=7, distortion="0.878516", orientation=19, skew="0.592905", color=steelblue3];
	V7M [sides=10, distortion="-0.960249", orientation=32, skew="0.460424", color=navy];
	"Ultrix-11" [sides=10, distortion="-0.633186", orientation=10, skew="0.333125", color=darkseagreen4];
	Xenix [sides=8, distortion="-0.337997", orientation=52, skew="-0.760726", color=coral];
	"UniPlus+" [sides=7, distortion="0.788483", orientation=39, skew="-0.526284", color=darkolivegreen3];
	"9th Edition" [sides=7, distortion="0.138690", orientation=55, skew="0.554049", color=coral3];
	"2 BSD" [sides=7, distortion="-0.010661", orientation=84, skew="0.179249", color=blanchedalmond];
	"2.8 BSD" [distortion="-0.239422", orientation=44, skew="0.053841", color=lightskyblue1];
	"2.9 BSD" [distortion="-0.843381", orientation=70, skew="-0.601395", color=aquamarine2];
	"3 BSD" [sides=10, distortion="0.251820", orientation=18, skew="-0.530618", color=lemonchiffon];
	"4 BSD" [sides=5, distortion="-0.772300", orientation=24, skew="-0.028475", color=darkorange1];
	"4.1 BSD" [distortion="-0.226170", orientation=38, skew="0.504053", color=lightyellow1];
	"4.2 BSD" [sides=10, distortion="-0.807349", orientation=50, skew="-0.908842", color=darkorchid4];
	"4.3 BSD" [sides=10, distortion="-0.030619", orientation=76, skew="0.985021", color=lemonchiffon2];
	"Ultrix-32" [distortion="-0.644209", orientation=21, skew="0.307836", color=goldenrod3];
	"PWB 1.2" [sides=7, distortion="0.640971", orientation=84, skew="-0.768455", color=cyan];
	"USG 1.0" [distortion="0.758942", orientation=42, skew="0.039886", color=blue];
	"CB Unix 1" [sides=9, distortion="-0.348692", orientation=42, skew="0.767058", color=firebrick];
	"USG 2.0" [distortion="0.748625", orientation=74, skew="-0.647656", color=chartreuse4];
	"CB Unix 2" [sides=10, distortion="0.851818", orientation=32, skew="-0.020120", color=greenyellow];
	"CB Unix 3" [sides=10, distortion="0.992237", orientation=29, skew="0.256102", color=bisque4];
	"Unix/TS++" [sides=6, distortion="0.545461", orientation=16, skew="0.313589", color=mistyrose2];
	"PDP-11 Sys V" [sides=9, distortion="-0.267769", orientation=40, skew="0.271226", color=cadetblue1];
	"USG 3.0" [distortion="-0.848455", orientation=44, skew="0.267152", color=bisque2];
	"Unix/TS 1.0" [distortion="0.305594", orientation=75, skew="0.070516", color=orangered];
	"TS 4.0" [sides=10, distortion="-0.641701", orientation=50, skew="-0.952502", color=crimson];
	"System V.0" [sides=9, distortion="0.021556", orientation=26, skew="-0.729938", color=darkorange1];
	"System V.2" [sides=6, distortion="0.985153", orientation=33, skew="-0.399752", color=darkolivegreen4];
	"System V.3" [sides=7, distortion="-0.687574", orientation=58, skew="-0.180116", color=lightsteelblue1];
	"5th Edition" -> "6th Edition";
	"5th Edition" -> "PWB 1.0";
	"6th Edition" -> LSX;
	"6th Edition" -> "1 BSD";
	"6th Edition" -> "Mini Unix";
	"6th Edition" -> Wollongong;
	"6th Edition" -> Interdata;
	Interdata -> "Unix/TS 3.0";
	Interdata -> "PWB 2.0";
	Interdata -> "7th Edition";
	"7th Edition" -> "8th Edition";
	"7th Edition" -> "32V";
	"7th Edition" -> V7M;
	"7th Edition" -> "Ultrix-11";
	"7th Edition" -> Xenix;
	"7th Edition" -> "UniPlus+";
	V7M -> "Ultrix-11";
	"8th Edition" -> "9th Edition";
	"1 BSD" -> "2 BSD";
	"2 BSD" -> "2.8 BSD";
	"2.8 BSD" -> "Ultrix-11";
	"2.8 BSD" -> "2.9 BSD";
	"32V" -> "3 BSD";
	"3 BSD" -> "4 BSD";
	"4 BSD" -> "4.1 BSD";
	"4.1 BSD" -> "4.2 BSD";
	"4.1 BSD" -> "2.8 BSD";
	"4.1 BSD" -> "8th Edition";
	"4.2 BSD" -> "4.3 BSD";
	"4.2 BSD" -> "Ultrix-32";
	"PWB 1.0" -> "PWB 1.2";
	"PWB 1.0" -> "USG 1.0";
	"PWB 1.2" -> "PWB 2.0";
	"USG 1.0" -> "CB Unix 1";
	"USG 1.0" -> "USG 2.0";
	"CB Unix 1" -> "CB Unix 2";
	"CB Unix 2" -> "CB Unix 3";
	"CB Unix 3" -> "Unix/TS++";
	"CB Unix 3" -> "PDP-11 Sys V";
	"USG 2.0" -> "USG 3.0";
	"USG 3.0" -> "Unix/TS 3.0";
	"PWB 2.0" -> "Unix/TS 3.0";
	"Unix/TS 1.0" -> "Unix/TS 3.0";
	"Unix/TS 3.0" -> "TS 4.0";
	"Unix/TS++" -> "TS 4.0";
	"CB Unix 3" -> "TS 4.0";
	"TS 4.0" -> "System V.0";
	"System V.0" -> "System V.2";
	"System V.2" -> "System V.3";
}
  • 图片:


#5

第一次使用MacOS,在terminal里使用pip安装了jupyter,最后需要用如下语句才能打开:

python -m IPython notebook

直接使用jupyter notebook打不开,可能是路径的原因,反正我是没解决。 而后,尝试了Anaconda2,再修改了path,语句如下:

export PATH=~/anaconda2/bin:$PATH

然后,就可以直接使用 jupyter notebook 调用啦,估计其他的package也能轻松调用,激动,之前一直嫌弃Anaconda太大,结果尝试了,还是有惊喜!

Anaconda官网:

Jupyter官网:

Stackoverflow解决方案:


#6

import a 、from a from b、from a import *区别

三个都是正确的写法,调用的是os包里path子项的join函数,作用是将路径相加成一个完整路径:

from os.path import * print(join(‘C:\windows’, ‘system32’))

from os.path import join print(join(‘C:\windows’, ‘system32’))

import os print(os.path.join(‘C:\windows’, ‘system32’))

import os.path print(os.path.join(‘C:\windows’, ‘system32’))

输出全是:C:\windows\system32

可以想像成左右两个容器,先装左边的,再装右边的。只装了左边的,就需要在语句中写出os.path.join()的包路径;左右都装了,就可以直接写出右边容器中的包,比如join()。

引用:

https://www.zhihu.com/question/38857862/answer/91028441


#7

SCI论文下载神器: http://sci-hub.hk/

目前还能用,先用着 :wink:


#8

参考scipy官网

https://docs.scipy.org/

1. numpy.random.rand(均匀分布)

scipy官方库,可查询用法 https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html

numpy.random.rand(d0, d1, …, dn)

Random values in a given shape.

Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1).

Parameters: d0, d1, …, dn : int, optional

The dimensions of the returned array, should all be positive. If no argument is given a single Python float is returned.

Returns: out : ndarray, shape (d0, d1, …, dn)

Random values.

2. numpy.random.randn(正态分布)

numpy.random.randn

numpy.random.randn(d0, d1, …, dn)

Return a sample (or samples) from the “standard normal” distribution.

If positive, int_like or int-convertible arguments are provided, randn generates an array of shape (d0, d1, …, dn), filled with random floats sampled from a univariate “normal” (Gaussian) distribution of mean 0 and variance 1 (if any of the d_i are floats, they are first converted to integers by truncation). A single float randomly sampled from the distribution is returned if no argument is provided.

This is a convenience function. If you want an interface that takes a tuple as the first argument, use numpy.random.standard_normal instead.

Parameters: d0, d1, …, dn : int, optional

The dimensions of the returned array, should be all positive. If no argument is given a single Python float is returned.

Returns: Z : ndarray or float

A (d0, d1, …, dn)-shaped array of floating-point samples from the standard normal distribution, or a single such float if no parameters were supplied.

See also

random.standard_normal

Similar, but takes a tuple as its argument.


#9

你可以用 echo $0 查看当前 shell 的名称。一般情况下这个 shell 都是 bash。一般的 shell 都用反斜杠 \ 表示换行,用 ctrl-d 表示输入终止,就直接运行该段代码了。


#10

tf.reduce_mean()

tf.reduce_mean( 
    input_tensor,
    axis=None,
    keepdims=None,
    name=None,
    reduction_indices=None,
    keep_dims=None
)

https://tensorflow.google.cn/api_docs/python/tf/reduce_mean

Defined in tensorflow/python/ops/math_ops.py.

See the guide: Math > Reduction

Computes the mean of elements across dimensions of a tensor. (deprecated arguments)

SOME ARGUMENTS ARE DEPRECATED. They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead

Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keepdims is true, the reduced dimensions are retained with length 1.

If axis has no entries, all dimensions are reduced, and a tensor with a single element is returned.

For example:

x = tf.constant([[1., 1.], [2., 2.]])
tf.reduce_mean(x)  # 1.5
tf.reduce_mean(x, 0)  # [1.5, 1.5]
tf.reduce_mean(x, 1)  # [1.,  2.]

Args:

  • input_tensor: The tensor to reduce. Should have numeric type.

  • axis: The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)].

  • keepdims: If true, retains reduced dimensions with length 1.

  • name: A name for the operation (optional).

  • reduction_indices: The old (deprecated) name for axis.

  • keep_dims: Deprecated alias for keepdims.

Returns:

The reduced tensor.

Numpy Compatibility Equivalent to np.mean

Please note that np.mean has a dtype parameter that could be used to specify the output type. By default this is dtype=float64. On the other hand, tf.reduce_mean has an aggressive type inference from input_tensor, for example:

x = tf.constant([1, 0, 1, 0])
tf.reduce_mean(x)  # 0
y = tf.constant([1., 0., 1., 0.])
tf.reduce_mean(y)  # 0.5

#11

三相交通理论

Three-phase traffic theory is a theory of traffic flow developed by Boris Kerner between 1996 and 2002.[1][2][3] It focuses mainly on the explanation of the physics of traffic breakdown and resulting congested traffic on highways. Kerner describes three phases of traffic, while the classical theories based on the fundamental diagram of traffic flow have two phases: free flow and congested traffic. Kerner’s theory divides congested traffic into two distinct phases, synchronized flow and wide moving jam, bringing the total number of phases to three:

  • Free flow (F)

  • Synchronized flow (S)

  • Wide moving jam (J)

A so-called “wide moving jam” moves upstream through any highway bottlenecks. While doing so, the mean velocity of the downstream front v_g is maintained. This is the characteristic feature of the wide moving jam that defines the phase J.

image

The word “wide” is used even though it is the length of the traffic jam that is being referred to.

A phase is defined as a state in space and time.

Flow rate versus vehicle density in free flow and congested traffic (fictitious data) image

Measured data of speed in time and space (a) and its representation on the time-space plane (b)


#12

#13

Traffic bottleneck

Traffic bottlenecks are disruptions of traffic on a roadway caused either due to road design, traffic lights, or accidents. There are two general types of bottlenecks, stationary and moving bottlenecks. Stationary bottlenecks are those that arise due to a disturbance that occurs due to a stationary situation like narrowing of a roadway, an accident. Moving bottlenecks on the other hand are those vehicles or vehicle behavior that causes the disruption in the vehicles which are upstream of the vehicle. Generally moving bottlenecks are caused by heavy trucks as they are slow moving vehicles with less acceleration and also may make lane changes.

image

Bottlenecks are important considerations because they impact the flow in traffic, the average speeds of the vehicles. The main consequence of a bottleneck is an immediate reduction in capacity of the roadway. The Federal Highway Authority has stated that 40% of all congestion is from bottlenecks figure 16 shows the pie-chart for various causes of congestion.


#14

又看到新东西~~~赞赞赞:+1::+1::+1:


#15

:grin::grin::grin::grin:


#16

瑞士开发的开源项目交通智能体仿真MATSim

https://www.matsim.org/

安装包下载渠道:

1、https://pan.baidu.com/s/1dEJVDGt?errno=0&errmsg=Auth%20Login%20Sucess&&bduss=&ssnerror=0&traceid=

2、https://github.com/matsim-org/matsim/releases/download/matsim-0.8.1/matsim-0.8.1.zip

中文教程:

https://blog.csdn.net/Afinezyboy666/article/details/79080921


#17

交通领域国际会议(汇总)

1. The Transportation Research Board (TRB) Annual Meeting

http://www.trb.org/AnnualMeeting/AnnualMeeting.aspx


#18

Heaviside step function


#19
source activate tensorflow

source deactivate


#20

https://www.cnblogs.com/yingchuan-hxf/p/7715575.html

若是你也遇到这个问题,说明你也没有理解tensorflow到底在哪里。

当安装了anaconda3.6后,在PyCharm中设置interpreter,这个解释器决定了你在PyCharm环境中写的代码采用什么方式去执行。

若是你的设置是anaconda下的python.exe。就会发现在PyCharm中写入import tensorflwo as tf 时,就会报错,提示没有tensorflow模块,这是因为anaconda文件下的python.exe是3.6版本的,而你创建的conda环境是在anaconda下,而你安装的tensorflow在了conda环境下,不是在anaconda环境下,因此若是你要导入tensorflow,则需要把解释器选择为conda环境下的python.exe。

当你的解释器选择如下图的红色框中,选择的interpreter是anaconda下的python.exe时,在PyCharm环境中导入tensorflow时,就会提示没有找到tensorflow模块。

若是你想使用tensorflow,则解释器应该选择,如下图路径(anaconda->envs->tenfowflow->python.exe)下的python.exe

解释器正确的选择如图所示,单击下图箭头所指的设置按钮,选择Add local,,选择上图显示的路径的python.exe,而不是anaconda下的python.exe,选择conda环境下的python.exe后,则会显示下图红色框中显示的设置。