<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Xiaoke,</div><div><br></div><div>The approaches are not wrong, you just need to add a little bit of C++ syntax craziness to it :)</div><div><br></div><div><span style="font-family: Monaco; font-size: 11px; text-decoration: underline; ">Simulator::Schedule(Seconds(hd), &ns3::ndn::Face::SetUp, face1, </span><span style="font-family: Monaco; font-size: 11px; text-decoration: underline; color: rgb(147, 26, 104); ">false</span><span style="font-family: Monaco; font-size: 11px; text-decoration: underline; ">);</span><br><div style="font-family: Helvetica; font-size: 13px; "><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span style="color: rgb(0, 97, 65); ">Simulator</span>::Schedule(Seconds(hd), &<span style="text-decoration: underline; font-size: 13px; ">ns3::ndn::Face::SetUp, </span><span style="font-size: 11px; ">face2,</span><span style="font-size: 11px; "> </span><span style="font-size: 11px; color: rgb(147, 26, 104); ">false</span><span style="font-size: 11px; ">);</span></div></div></div><div><div style="font-family: Helvetica; font-size: 13px; "><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div></div></div><div>Or, if you define the FailLink function (as a global function or static in some class), you can do a little bit simpler things</div><div><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; line-height: 14px; border-top-width: 1px; border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-bottom-color: rgb(170, 204, 153); font-size: 12px; "><span class="kt" style="color: rgb(144, 32, 0);">void</span>
<span class="nf" style="color: rgb(6, 40, 126);">FailLinks</span> <span class="p">(</span><span class="n">Ptr</span><span class="o" style="color: rgb(102, 102, 102);"><</span><span class="n">Node</span><span class="o" style="color: rgb(102, 102, 102);">></span> <span class="n">node1</span><span class="p">,</span> <span class="n">Ptr</span><span class="o" style="color: rgb(102, 102, 102);"><</span><span class="n">Node</span><span class="o" style="color: rgb(102, 102, 102);">></span> <span class="n">node2</span><span class="p">)</span>
</pre></div><div><span class="p"><br></span></div><div>Simulator::Schedule (Seconds (10.0), FailLinks, Names::Find<Node> ("node1"), Names::Find<Node> ("node2"));</div><div><br></div><div><br></div><div>I haven't checked, but I hope this code should compile. Let me know if it doesn't, so I'll double check.</div><div><br></div><div>---</div><div>Alex</div><div><br></div><br><div><div>On Jul 9, 2013, at 11:44 PM, Xiaoke Jiang <<a href="mailto:shock.jiang@gmail.com">shock.jiang@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
                <div style="font-family: Helvetica; font-size: 13px; ">thank you, Alex. But I have to fail the link at a specified time:<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">    </span>          <span style="text-decoration: underline">Simulator::Schedule(Seconds(hd), &&ns3::ndn::Face::SetUp, face1, </span><span style="text-decoration: underline ; color: #931a68">false</span><span style="text-decoration: underline">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre"> </span>          <span style="color: #006141">Simulator</span>::Schedule(Seconds(hd), &face2->SetUp, <span style="color: #931a68">false</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">The above two approaches are wrong. What is your suggestion?</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div></div></div>
                <div><div><br></div><div style="font-family: Futura; font-size: 13px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="'comic sans ms', sans-serif">thanks</font><br><br><font face="garamond, serif"><font size="4">My Regards,</font><br></font></div><hr align="left" size="1" style="color: rgb(34, 34, 34); font-size: small; font-family: arial; width: 210px; min-height: 1px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="garamond, serif"><div><span style="font-size: 10.5pt; ">Xiaoke (Shock) Jiang (蒋小可)</span></div><div><span style="font-size: 10.5pt; "><br></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Ph.D. Candidate,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Department of Computer Science and Technology,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Tsinghua University, Beijing, P.R.China. 100084</font></span></div></font></div></div></div><p style="color: #A0A0A8;">On Wednesday, July 10, 2013 at 2:09 PM, Alex Afanasyev wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><meta http-equiv="content-type" content="text/html; charset=utf-8"><div style="-webkit-text-size-adjust: auto; ">With point to point links you cannot remove any of them, but you can "fail" them.  You can try to make something base on this example: <span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><a href="http://ndnsim.net/faq.html#code-questions">http://ndnsim.net/faq.html#code-questions</a></span></div><br>To get Ptr<Node> from string (defined in the topology file), just use something like this: Names::Find<Node> ("node1")---<div style="-webkit-text-size-adjust: auto; ">Alex</div><div style="-webkit-text-size-adjust: auto; "><br>On Jul 9, 2013, at 10:40 PM, Xiaoke Jiang <<a href="mailto:shock.jiang@gmail.com">shock.jiang@gmail.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto; "><div>
                <div>
                    Dear all,
                </div><div><span style="white-space:pre">   </span>I read a topology with AnnotatedTopologyReader, now I am trying to disable a link, say link between node1 and node2, anyone can give me any hint?</div>
                <div><div><br></div><div style="font-family: Futura; font-size: 13px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="'comic sans ms', sans-serif">thanks</font><br><br><font face="garamond, serif"><font size="4">My Regards,</font><br></font></div><hr align="left" size="1" style="color: rgb(34, 34, 34); font-size: small; font-family: arial; width: 210px; min-height: 1px; "><div style="color: rgb(34, 34, 34); font-size: small; background-color: rgb(255, 255, 255); font-family: arial; "><font face="garamond, serif"><div><span style="font-size: 10.5pt; ">Xiaoke (Shock) Jiang (蒋小可)</span></div><div><span style="font-size: 10.5pt; "><br></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Ph.D. Candidate,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Department of Computer Science and Technology,</font></span></div><div><span style="font-size: 10.5pt; "><font color="#666666">Tsinghua University, Beijing, P.R.China. 100084</font></span></div></font></div></div></div>
            </div><div><span>_______________________________________________</span><br><span>ndnSIM mailing list</span><br><span><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a></span><br><span><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></span><br></div></blockquote></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>
            </blockquote></div><br></body></html>