Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN MATLAB CODE PLEASE! [Task 2 - function supdateS (s,t,A,isVac, thresholdVac, thresholdNonVac) Update the s matrix (the infection-status-vs-time matrix) to add infection status data to

IN MATLAB CODE PLEASE!

[Task 2 - function supdateS (s,t,A,isVac, thresholdVac, thresholdNonVac) Update the s matrix (the infection-status-vs-time matrix) to add infection status data to the column t+1 s (logical) s (logical) 1 2 3 45 1 2 3 45 1 11 0 0 0 2 0 1 0 0 0 1 1 1 1 0 0 2 0 1 1 3 0 0 4 0 0 4 0 01 00 Time step: 2 of 5 Time step: 3 of 5 0.5 0.5 0.5 0.5 Idea: .The current time step is t, e.gt 2. .The next time step is t+1, which is 3. .Current infection status the column t of s matrix, which is known. Find the column t+1 of s matrix, which is not known yet. Pseudocode: (one of many approaches, not efficient, but easier to explain) For person P, from 1 to N If person P is already infected in the current time step (t), then will remain infected in the next time step (t+1) else (person P is healthy), then, find how many neighbors of person P is infected. if number of infected neighborsthreshold of person P % else (person P will be healthy in the next time step) end then person P becomes infected at the next time step (t+1). % Do nothing. Already preallocate the whole matrix as false. end] image text in transcribed

IVE BEEN TOLD THE BELOW IS THE ANSWER BEFORE, IT IS NOT PLEASE DO NOT POST THIS AGAIN

#include #include #include #include #include #include #include 

#include

// PURPOSE: To tell the maximum value that a tree can have. const int MAX_VALUE = 64; // PURPOSE: To tell how many problems to do. const int NUM_PROBLEMS = 4096; #include "Node.h" #include "NodeBuffer.h"
Task 2 - function supdateS (s,t,A,isVac, thresholdVac, thresholdNonVac) Update the s matrix (the infection-status-vs-time matrix) to add infection status data to the column t+1 s (logical) s (logical) 1 2 3 45 1 2 3 45 1 11 0 0 0 2 0 1 0 0 0 1 1 1 1 0 0 2 0 1 1 3 0 0 4 0 0 4 0 01 00 Time step: 2 of 5 Time step: 3 of 5 0.5 0.5 0.5 0.5 Idea: .The current time step is t, e.gt 2. .The next time step is t+1, which is 3. .Current infection status the column t of s matrix, which is known. Find the column t+1 of s matrix, which is not known yet. Pseudocode: (one of many approaches, not efficient, but easier to explain) For person P, from 1 to N If person P is already infected in the current time step (t), then will remain infected in the next time step (t+1) else (person P is healthy), then, find how many neighbors of person P is infected. if number of infected neighborsthreshold of person P % else (person P will be healthy in the next time step) end then person P becomes infected at the next time step (t+1). % Do nothing. Already preallocate the whole matrix as false. end Task 2 - function supdateS (s,t,A,isVac, thresholdVac, thresholdNonVac) Update the s matrix (the infection-status-vs-time matrix) to add infection status data to the column t+1 s (logical) s (logical) 1 2 3 45 1 2 3 45 1 11 0 0 0 2 0 1 0 0 0 1 1 1 1 0 0 2 0 1 1 3 0 0 4 0 0 4 0 01 00 Time step: 2 of 5 Time step: 3 of 5 0.5 0.5 0.5 0.5 Idea: .The current time step is t, e.gt 2. .The next time step is t+1, which is 3. .Current infection status the column t of s matrix, which is known. Find the column t+1 of s matrix, which is not known yet. Pseudocode: (one of many approaches, not efficient, but easier to explain) For person P, from 1 to N If person P is already infected in the current time step (t), then will remain infected in the next time step (t+1) else (person P is healthy), then, find how many neighbors of person P is infected. if number of infected neighborsthreshold of person P % else (person P will be healthy in the next time step) end then person P becomes infected at the next time step (t+1). % Do nothing. Already preallocate the whole matrix as false. end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the bundle-of-sticks idea as it relates to real property.

Answered: 1 week ago

Question

Define particulate inheritance.

Answered: 1 week ago

Question

Define Scientific Management

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

3. Outline the four major approaches to informative speeches

Answered: 1 week ago

Question

4. Employ strategies to make your audience hungry for information

Answered: 1 week ago