How to connect two CAN channels in vector canoe? - simulation

I have 2 CAN channels assigned. Number one with generator, transmitter:
and Number 2 which will be receiver:
How to connect this channels to each other and make the communicate?

Related

Simulink: For Each Subsystem does not detect iteration amount

For some reason when I connect a For Each Subsystem to an output block it is unable to detect the iteration amount and will only iterate once:
When I connect it to something else, a scope in this case, it will iterate 5 times as it should:
The output connects to a demux with a dimension of 5 further in the simulation which in the first case fails:
Error in port widths or dimensions. Input port 1 of
'control/Camera/Motor bar/Demux1' is a one dimensional vector with 5
elements.
The output port was not the cause of the issue.
A little further on I had a Demux element which could not handle a one dimensional vector with 5 elements.
The error mentioned this properly.

Getting total number of objects during simulation OMNET++/VEINS

I am running VEINS simulation for VANETs. Is there a way to access the total number of cars being simulated during a specific time in OMNET++?(I am trying to count the number of packets being exchanged between cars, and since I am broadcasting it, I thought multiplying the packet sent to the number of vehicles being simulated would provide a good indicator of how many received packets count should be).
The return value of TraCIScenarioManager::getManagedHosts contains all active vehicles. You should get the same result as if you manually iterate over (and then filter) all submodules of your network using cModule::SubmoduleIterator.

Is the second argument in connect() indefinite or limited to 0-5

If you want to use channel splitters and/or channel mergers you need to use the second and third arguments in the connect(node,0,0) method.
I want to know if these numbers are limited to 5 channels or if these arguments are indefinite numbers.
splitter.connect(node,0) // is this number limited to 0-5 ?
It seems like the spec should be indefinite to handle odd multi channel file types but it seems that it is relegated to 6 channels and less.
A splitter node can have as many channels as you want (up to some limit). You have to specify how many when you create the splitter. The default is 6. See http://webaudio.github.io/web-audio-api/#widl-BaseAudioContext-createChannelSplitter-ChannelSplitterNode-unsigned-long-numberOfOutputs

compare a network with multi value of a variable

I have a network and simulate it in netlogo.In my network i have n nodes with a random data from [0.1,2,...,19].
at the beginning one random node became sink and 3 random nodes start to send its data to sink.i declare a variable named gamma.after nodes send their data to sink,sink decide to whether store that data in its memory space or not base on gamma.after 0.5s this process repeat.at each time some nodes are sink and want some data.this is the way i distribute data in my network.
after all i have to change gamma from 0 to 1 to determine best value for that. and each time run my code to plot count of something.i mean:first run my code with gamma=1 and after run it again with gamma=0.98 and ...
if Entropy <= gamma
[
do something
]
If i press the setup button each time i change gamma my network setup change and i can not compare the same network with another gamma.
How can i compare my network with multi value of gammas??
I mean is that possible to save all my process and run it exaclly the same again?
You can use random-seed to always create the same network and then use a new seed (created and set with random-seed new-seed) to generate the random numbers and ask order etc for your processing. The tool BehaviorSpace will allow you to do many runs with different values of gamma.
Using this approach will guarantee you the same network. However, just because a particular value of gamma is best for one network, does not make it the best for other networks. So you could create multiple networks with different seeds and have NetLogo select each network (as #David suggests) or you could simply allow NetLogo to create the different networks and run many simulations so that you have a more robust answer that works over an 'average' network.
It is possible if you design some tests first, when you put random data each time you press setup the previous graph is not the same as the new one, thus you'll need to load the same data everytime you want to test.
An idea:
Make text files with the node data and the value of gamma. For 4 nodes you'd have something like:
dat1.txt
1 3 2 9
1
dat2.txt
1 3 2 9
0.98
dat3.txt
1 3 2 9
0.96
And so on...
You can genereate this files with a procedure and an specific seed (see random-numbers), this means that if you want to generate 30 tests (30 sets of 4 nodes in the above example), you'll need 30 different seeds.

Graphs: Nodes with max degree of 4, each node tries to connect to 4 nearest nodes - how many connections lost?

I am currently looking into spatially embedded networks, and am having trouble finding an answer for the following. Lets say I have a network with N nodes. Each of these nodes are located in space, and have 4 ports from which a connection can be made (meaning each node has a maximum degree of 4). Each node tries to connect with its 4 closest neighbors. (Links are bidirectional)
The following problem occurs:
As connections are added, certain nodes will reach their maximum degree. Another node may have this node as one of its closest neighbors, but can't connect to it because the other node cannot accept anymore connections. These 'attempts' are highlighted in red.
Is there any way to generalize this problem and determine how many connections are possible within the graph? How does the ordering in which connections are made affect the results?
The order of connections are made is irrelevant. Suppose, the connections are established at once without maximal node degree restriction. After that, some of the nodes can have more connections than is allowed. Therefore, you have to remove some of the newly added connections to satisfy the restriction. Nevertheless, how many connections have to be removed is defined, though, which connections is not.
If you have a criterion which evaluates your network you can use dynamic programming approach to remove invalid connections in a newly established network to maximize value of the network.