How to set laneclose in VISSIM? - traffic-simulation

enter image description here
enter image description here
I set the attribute "BlockedVehClasses" of bottleneck link's rightmost lane (lane1) as "10 20 30 40 50 60"(all) in VISSIM.
However, as I start the simulation, cars still drive into lane1 when the traffic flow is large.
I want cars never drive into lane1 even if they wait.
What should I do?
Besides, the attribute "laneclose" in com of VISSIM4 is replaced by which function in VISSIM11?
I would appreciate it if you could help me slove these problems.

Related

Read pdf page size on .NET Core

I have only one requirement. I need to read PDF page size and determine if page is not bigger then 17x17 inches to not send it to some external service which rejects such pdfs.
Is there any free library working on .NET Core? I wasn't able to find it. Or maybe anyone implemented this by reading binary file?
A pdf does not HAVE TO declare page size externally since every page can be a different size thus 100 pages may be 100 different page sizes.
However many PDF will contain a text entry for one or more pages so you can (depending on construction) parse as text for /MediaBox and or potentially /CropBox dimensions.
So the first PDF example I pick on and open to search for /MediaBox in WordPad tells me its 210 mm x 297 mm (i.e my local A4) /MediaBox [0 0 594.95996 841.91998] and for a 3 page file all 3 entries are the same.
you can try that using command line as
type "filename.pdf" | find /i "/media"
but may not work in all cases so a bigger chance of result (but more chaff) is
type "filename.pdf" | findstr /i "^/media ^/crop"
The value is based on the default number of point size units per inch (so can be divided by 72 as a rough guide), however, thats not your aim since you know you dont want more that 17x72=1224.
So in simple terms, if either value was over 1224 then I could reject as "TOO BIG".
HOWEVER I need to also consider those two 0 values, thus if one was +100 then the limit becomes 100 more and more importantly, if one was -100 then your desired 17" restriction will fail at 1124.
So you can write in any method or language (even CMD) a simple test, however, that will require too much expanding to cover all cases, SO:-
Seriously I would use / shell a one line command tool like xpdf/poppler pdfinfo to parse all different types of PDF and then grep that output.
The output is similar for both with many lines but for your need
xpdf\pdfinfo -box filename
gives Page size: 594.96 x 841.92 pts (A4) (rotated 0 degrees)
and
poppler\pdfinfo -box filename
gives Page size: 594.96 x 841.92 pts (A4)
Thus to check the file does not exceed 17" (in either direction) it should be easy to set a comparison testing that both values are under 1224.01

AzerothCore: set creature MovementType 1 does not make it random move

Yesterday I compiled AzerothCore, by following the step by step guide. I have a working server so decided to make some small edits, just to test.
I am using https://github.com/BAndysc/WoWDatabaseEditor/blob/master/README.md to edit the database.
I'm trying to make Argent Commander have random movement with the code below this post, but somehow they do not start moving. Any guess where i'm wrong at?
Note: Argent Commander should not have random movement, just doing this as a test.
UPDATE `creature_template` SET `MovementType` = 1 WHERE `entry` = 37965;
you have to also set wander_distance for the npc in creature table
https://www.azerothcore.org/wiki/creature#wander_distance
Sadly you can't do that yet in the wow db editor editor

How to use create-<breeds>-with between two breed turtle agents?

I've been stuck by this issue for a long time. I have two networks in my model, so I want to create different types of links with different breed turtle agentsets.
Let's name the 1st turtle agentset T1 and the 2nd T2, so what I did is the following:
breed [T1s T1]
undirected-link-breed [TL1s TL1]
breed [T2s T2]
undirected-link-breed [TL2s TL2]
;;Got error report
ask T1s [create-TL1s-with other n-of 10 T1s]
The last line gave an error reporting that "You cannot use breeded and unbreeded links in the same world". I'm quite confused about what this means.
And then, I changed the last line to:
ask T1s [create-links-with other n-of 10 T1s]
It worked this time, but if that's the case, how can I define two different types of links, i.e., TL1 and TL2, with different turtle agentsets T1s and T2s?
Can anybody help me out? I really appreciate it!
Thanks
That error means that you've created some links that have no breed (probably with create-link-with) before creating links with a breed, or vice-versa. If you want to use link breeds, you can never use create-link-with, create-link-to, or create-link-from. You must always use create-<breed>-with, create-<breed>-to, and create-<breed>-from.
So, search your code for instances of create-link-with, create-link-to, or create-link-from and either delete them or change them to create-<breed>-with, create-<breed>-to, or create-<breed>-from. If you're still getting the error, call clear-all or clear-links to make sure you've removed all unbreeded links.

How can I read a line of input in Inform 7?

I just want to prompt the user for a line of text in the middle of an action. The effect should be like this:
> north
The robot steps in front of you as you approach the gate.
"PAASSWAAAAWRD!!" it bellows.
Enter the password: _
At this point the game should pause and let the player try to guess the password. For example, suppose I guess “fribble”, which is not the password:
Enter the password: fribble
"WRONG PASSWAAARD!" roars the robot. "CHECK CAPS LAAAWWWWK!"
>
The behavior I want is similar to if the player consents, but I want the whole line of input, not just a yes or no.
Inform offers no easy way to do this, though you might be able to get to the keyboard primitives by dropping to Inform 6.
However it is possible to achieve the desired effect:
The Loading Zone is a room. "Concrete with yellow stripes. The Hold is north."
The robot is an animal in the Loading Zone. "However, a robot the size of an Arcturan megaladon guards the way."
North of the Loading Zone is the Hold.
Instead of going north from the Loading Zone:
say "The robot steps in front of you as you approach the gate. 'PAASSWAAAAWRD!!' it bellows.";
now the command prompt is "Enter password: ".
After reading a command when the command prompt is "Enter password: ":
if the player's command matches "xyzzy":
say "The robot folds itself up into a cube to let you pass.";
move the player to the Hold;
otherwise:
say "'WRONG PASSWAAARD!' roars the robot. 'CHECK CAPS LAAAWWWWK!'";
now the command prompt is ">";
reject the player's command.
I think this sort of thing is considered poor gameplay: it forces the player to guess, which damages the player's illusion of control and choice. The more conventional way would be to require the player to say the password:
The Loading Zone is a room. "Concrete with yellow stripes. The Hold is north."
The robot is an animal in the Loading Zone. The robot is either awake or asleep. The robot is awake. "[if awake]However, a robot the size of an Arcturan megaladon guards the way.[otherwise]A cube of metal the size of an Arctural megaladon snores loudly.[end if]".
North of the Loading Zone is the Hold.
Instead of going north from the Loading Zone when the robot is awake:
say "The robot steps in front of you as you approach the gate. 'PAASSWAAAAWRD!!' it bellows."
Instead of answering the robot that some text:
if the topic understood matches "xyzzy":
say "The robot folds itself up into a cube to let you pass.";
now the robot is asleep;
otherwise:
say "'WRONG PASSWAAARD!' roars the robot. 'CHECK CAPS LAAAWWWWK!'"
The commands say xyzzy and answer xyzzy and robot, xyzzy and say xyzzy to robot will all work.
The extension Questions by Michael Callaghan will help with this. Note that you might not be able to reliably test input case sensitively.
Dropping to I6 like this works in Inform 7.9.3. This is probably a bad idea.
Section 1 - Line input
Include (- Global user_input = 100; -) after "Parser.i6t".
The user input is a snippet that varies. The user input variable translates into I6 as "user_input".
To get a line of input: (-
KeyboardPrimitive(buffer, parse);
user_input = 100 + WordCount();
-).
You can then use the phrase "get a line of input" to read a line, and the phrase "the user's input" gives the line they entered. (A snippet is a kind of text.)
The example then looks like this:
Section 2 - Example
The Loading Zone is a room. "Concrete with yellow stripes. The Hold is north."
The robot is an animal in the Loading Zone. "However, a robot the size of an Arcturan megaladon guards the way."
North of the Loading Zone is the Hold.
Instead of going north from the Loading Zone:
say "The robot steps in front of you as you approach the gate. 'PAASSWAAAAWRD!!' it bellows.[paragraph break]";
say "Enter password: ";
get a line of input;
if the user input matches "xyzzy":
say "The robot folds itself up into a cube to let you pass.";
move the player to the Hold;
otherwise:
say "'WRONG PASSWAAARD!' roars the robot. 'CHECK CAPS LAAAWWWWK!'".
Test me with "n / password / n / xyzzy".

How to control the echo width using Sweave

I have a problem with the width of the output from echo within sweave, I have a list with a large amount of text. The problem is the echo response from R runs off the page within the pdf. I have tried using
<<>>=
options(width=40)
#
but this has not changed anything.
An example: Set up the list (not showing in latex).
<<echo=FALSE>>=
my_list <- list(example="Site location was fixed using a Silvia Navigator handheld GPS in October 2003. Point of reference used was the station Bench Mark. If the bench mark location was remote from the site then the point of reference used was changed to the 0-1 metre gauge. Bench Mark location was then recorded as a separate entry in the Site History section [but not used as the site location].\r\nFor a Station location map and all digital photograph's of the station, river reach, and site details see H:\\hyd\\dat\\doc. For non digital photo's taken prior to October 2003 please see the relevant station file at Tumut office.")
#
And show the entry of the list.
<<>>=
my_list
#
Is there any way that I can get this to work without having to break up the list with cat statements.
You can use capture.output() to capture the printed representation of the list and then use writeLines() and strwrap() to display this output, nicely wrapped. As capture.output() returns a vector of strings containing the printed representation of the object, we can cat each of them to the screen/page but wrapped using strwrap(). The benefit of this approach is that the result looks like it was printed by R. Here's the solution:
writeLines(strwrap(capture.output(my_list)))
which produces:
$example
[1] "Site location was fixed using a Silvia Navigator
handheld GPS in October 2003. Point of reference used
was the station Bench Mark. If the bench mark location
was remote from the site then the point of reference used
was changed to the 0-1 metre gauge. Bench Mark location
was then recorded as a separate entry in the Site History
section [but not used as the site location].\r\nFor a
Station location map and all digital photograph's of the
station, river reach, and site details see
H:\\hyd\\dat\\doc. For non digital photo's taken prior
to October 2003 please see the relevant station file at
Tumut office."
From a 2010 posting to rhelp by Mark Schwartz:
cat(paste(strwrap(x, width = 70), collapse = "\\\\\n"), "\n")

Resources