<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Zhiyi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your suggestion. Yes, I tried it. It did not work on ndnSIM. When I have the variable as static, whenever the variable is getting updated, it is getting updated for all the nodes in the simulation. So at a time, all the nodes have the same value
 for this variable.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-Muktadir</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Zhiyi Zhang <Zhiyi.Zhang@ucla.edu><br>
<b>Sent:</b> Tuesday, January 7, 2020 2:33 PM<br>
<b>To:</b> Junxiao Shi <shijunxiao@email.arizona.edu><br>
<b>Cc:</b> Muktadir R Chowdhury (mrchwdhr) <mrchwdhr@memphis.edu>; ndnsim <ndnsim@lists.cs.ucla.edu><br>
<b>Subject:</b> Re: [ndnSIM] Strategy specific info</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi Muktadir,
<div><br>
</div>
<div>Can you add a static variable, say in your cpp file, and let your strategy class instance visit that global variable to change it?</div>
<div><br>
</div>
<div>Best,</div>
<div>Zhiyi</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Jan 7, 2020 at 11:00 AM Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu">shijunxiao@email.arizona.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="auto">
<div>Hi Muktadir</div>
<div dir="auto"><br>
</div>
<div dir="auto">Strategy is stateless. It can only attach measurements on namespaces under its control.</div>
<div dir="auto">See Section 3.3 of original NDN paper <a href="https://named-data.net/publications/networkingnamedcontent/" target="_blank">https://named-data.net/publications/networkingnamedcontent/</a> for rationale of this design decision.</div>
<div dir="auto">Thus, what you desire cannot be supported.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Yours, Junxiao<br>
<br>
<div class="x_gmail_quote" dir="auto">
<div dir="ltr" class="x_gmail_attr">On Mon, Jan 6, 2020, 12:08 Muktadir R Chowdhury (mrchwdhr) <<a href="mailto:mrchwdhr@memphis.edu" target="_blank">mrchwdhr@memphis.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I have written a strategy which needs to have states that are specific to the strategy, not to the namespace.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
(1)  <span style="margin:0px">Lets say I have the following strategy:</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
<span style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline">NFD_REGISTER_STRATEGY(<span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline">CustomStrategy</span>);</span>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)">class CustomStrategy : Strategy {</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)">void</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)">afterReceiveInterest() {</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)"> cout << "v=" <<v << endl;  </span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)"> v ++;</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)">}</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)">private:</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)"> int v = 0;</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<span style="margin:0px; color:rgb(50,49,48); background-color:rgba(0,0,0,0)">}</span></div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
I want the variable "v" to be Strategy specific.</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
<br>
</div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
(2) I set CustomStrategy for two prefixes, lets say "/a" and '/b". </div>
<div style="margin:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
<div style="margin:0px; color:rgb(50,49,48)"><br>
</div>
<div style="margin:0px; color:rgb(50,49,48)"><span style="margin:0px; font-size:12pt; font-family:calibri,arial,helvetica,sans-serif; color:rgb(0,0,0); background-color:rgba(0,0,0,0)">(3) I send two interests under "/a", lets say "/a/1" and "/a/2". The value
 of "v" should be 2.</span></div>
<div style="margin:0px; color:rgb(50,49,48)"><span style="margin:0px; font-size:12pt; font-family:calibri,arial,helvetica,sans-serif; color:rgb(0,0,0); background-color:rgba(0,0,0,0)">    v=0 and v=1 should be printed.</span></div>
<div style="margin:0px; color:rgb(50,49,48)"><span style="margin:0px; font-size:12pt; font-family:calibri,arial,helvetica,sans-serif; color:rgb(0,0,0); background-color:rgba(0,0,0,0)"><br>
</span></div>
<div style="margin:0px; color:rgb(50,49,48)"><span style="margin:0px; font-size:12pt; font-family:calibri,arial,helvetica,sans-serif; color:rgb(0,0,0); background-color:rgba(0,0,0,0)">(4) Now I send one interest under "/b" ("/b/1"). I was expecting it to print
 v=2. But it printed v=0.</span></div>
<div style="margin:0px; color:rgb(50,49,48)"><span style="margin:0px; font-size:12pt; font-family:calibri,arial,helvetica,sans-serif; color:rgb(0,0,0); background-color:rgba(0,0,0,0)"><br>
</span></div>
<div style="margin:0px; color:rgb(50,49,48)"><font color="#000000" face="calibri, arial, helvetica, sans-serif">I guess the reason is , for two different namespace ("/a" and "/b"), two different instances of CustomStrategy is created. I have also tried adding
 this Strategy specific info in the Measurement Table, like it is done in <a href="https://github.com/named-data/NFD/blob/master/daemon/fw/asf-measurements.hpp" title="https://github.com/named-data/NFD/blob/master/daemon/fw/asf-measurements.hpp" rel="noreferrer" target="_blank">
ASF strategy</a> But find out for different namespace, measurement entries are different. Can anyone give me suggestions what can I do here?</font></div>
<div style="margin:0px; color:rgb(50,49,48)"><font color="#000000" face="calibri, arial, helvetica, sans-serif"><br>
</font></div>
<div style="margin:0px; color:rgb(50,49,48)"><font color="#000000" face="calibri, arial, helvetica, sans-serif">Muktadir Chowdhury</font></div>
<div style="margin:0px; color:rgb(50,49,48)"><font color="#000000" face="calibri, arial, helvetica, sans-serif">University of Memphis</font></div>
<br>
</div>
</div>
<br>
</blockquote>
</div>
</div>
</div>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote>
</div>
</div>
</body>
</html>