我正在模拟会议室中的会议,我以Bank Renege的示例为模型开始。
它正在按预期的方式工作-第一个版本只是试图在几个小时内将5个会议放入3个房间。
但是,我注意到排队的请求(没有会议室的请求)累积在Resource.queue列表中。他们不应该释放并消失吗?这是我的错误吗?我试过了
要求取消
simpy。中断
以及其他一些尝试,但我无法判断。
@enum SCNetworkReachabilityFlags
@discussion Flags that indicate whether the specified network
nodename or address is reachable, whether a connection is
required, and whether some user intervention may be required
when establishing a connection.
@constant kSCNetworkReachabilityFlagsTransientConnection
This flag indicates that the specified nodename or address can
be reached via a transient connection, such as PPP.
@constant kSCNetworkReachabilityFlagsReachable
This flag indicates that the specified nodename or address can
be reached using the current network configuration.
@constant kSCNetworkReachabilityFlagsConnectionRequired
This flag indicates that the specified nodename or address can
be reached using the current network configuration, but a
connection must first be established.
As an example, this status would be returned for a dialup
connection that was not currently active, but could handle
network traffic for the target system.
@constant kSCNetworkReachabilityFlagsConnectionOnTraffic
This flag indicates that the specified nodename or address can
be reached using the current network configuration, but a
connection must first be established. Any traffic directed
to the specified name or address will initiate the connection.
Note: this flag was previously named kSCNetworkReachabilityFlagsConnectionAutomatic
@constant kSCNetworkReachabilityFlagsInterventionRequired
This flag indicates that the specified nodename or address can
be reached using the current network configuration, but a
connection must first be established. In addition, some
form of user intervention will be required to establish this
connection, such as providing a password, an authentication
token, etc.
Note: At the present time, this flag will only be returned
in the case where you have a dial-on-traffic configuration
(ConnectionOnTraffic), where an attempt to connect has
already been made, and where some error (e.g. no dial tone,
no answer, bad password, ...) was encountered during the
automatic connection attempt. In this case the PPP controller
will stop attempting to establish a connection until the user
has intervened.
@constant kSCNetworkReachabilityFlagsConnectionOnDemand
This flag indicates that the specified nodename or address can
be reached using the current network configuration, but a
connection must first be established.
The connection will be established "On Demand" by the
CFSocketStream APIs.
Other APIs will not establish the connection.
@constant kSCNetworkReachabilityFlagsIsLocalAddress
This flag indicates that the specified nodename or address
is one associated with a network interface on the current
system.
@constant kSCNetworkReachabilityFlagsIsDirect
This flag indicates that network traffic to the specified
nodename or address will not go through a gateway, but is
routed directly to one of the interfaces in the system.
@constant kSCNetworkReachabilityFlagsIsWWAN
This flag indicates that the specified nodename or address can
be reached via an EDGE, GPRS, or other "cell" connection.
答案 0 :(得分:0)
不,那不是错误。如果使用with语句以请求的方式请求资源,则所有未获取资源的请求将最终进入队列,并等待直到资源再次可用。您要取消这些请求吗?