📄 codeproject_crispin2.aspx.htm
字号:
<div class="MI" id="Section62"><a href="http://www.codeproject.com/KB/scrapbook/">Scrapbook</a></div>
<div class="MI" id="Section48"><a href="http://www.codeproject.com/KB/system/">Hardware & System</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=12" onclick="return ToggleMenu('Chapter12');">Third Party Products</a></div>
<div class="MenuSectionBlock" id="Chapter12" style="display: none;">
<div class="MI" id="Section65"><a href="http://www.codeproject.com/KB/showcase/">Product Showcase</a></div>
<div class="MI" id="Section124"><a href="http://www.codeproject.com/KB/solution-center/">Solution Center</a></div>
</div>
</div>
<br>
<div class="MenuCat">Services</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Jobs/List.aspx">Job Board</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Services/coffee.aspx">Code Project Coffee</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Services/TradePub.aspx">Free Magazines</a></div>
<br><div class="MenuCat">Feature Zones</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/kb/Showcase/">Product Showcase</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Zones/IBM">IBM DeveloperWorks</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Zones/WhitePapers">WhitePapers / Webcasts</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Zones/Acresso">InstallShield 2009</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Zones/APress">Apress Bookstore</a></div>
<br>
<div style="text-align: center; margin-bottom: 10px;">
<script type="text/javascript">document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d7689%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fAdm%252fimages%252fPDClogo.png%26C%3dFalse%26adid%3d7689%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22150%22%20height%3d%2280%22%3e%3c%2fa%3e"));</script><a href="http://www.codeproject.com/Redir.aspx?adid=7689&way=ban" target="_blank" rel="nofollow"><img src="codeproject_crispin2.aspx_files/ServeImg_002.htm" alt="" width="150" border="0" height="80"></a>
</div>
<iframe src="codeproject_crispin2.aspx_files/ServeHTML_002.htm" scrolling="no" width="160" frameborder="0" height="600"></iframe>
</td>
<td class="ArticlePane" valign="top">
<table class="SearchHeaderBar" width="100%" cellspacing="0">
<tbody><tr>
<td style="white-space: nowrap; width: 60%;" valign="middle" align="right">
<form method="get" action="/info/search.aspx" name="Search" style="margin: 0pt;">
<b>Search </b>
<input class="SmallText" name="artkw" style="width: 200px;">
<select class="SmallText" style="font-weight: bold;" name="sbo">
<option value="kw">Articles</option>
<!--<option value="au">Authors</option>-->
<option value="fm">Messages</option>
<option value="s">Jobs</option>
</select>
<input class="SmallText" style="font-weight: bold;" value=" Go! " type="submit">
</form>
</td>
<td class="TinyText" style="white-space: nowrap;">
<a href="http://www.codeproject.com/info/search.aspx">Advanced Search</a><br>
<a href="http://www.codeproject.com/script/Content/SiteMap.aspx">Sitemap</a>
</td>
</tr>
</tbody></table>
<span id="ctl00_ResultMessage"></span>
<div id="ctl00_ArtDiv">
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr valign="top">
<td valign="top" width="100%">
<table>
</table>
<div class="SmallText">
<img src="codeproject_crispin2.aspx_files/print.gif" alt="print" style="vertical-align: middle;" width="16" height="16">
<a id="ctl00_ArticleHeaderLinks_PrintLnk" href="http://www.codeproject.com/KB/recipes/codeproject_crispin2.aspx?display=Print">Print</a>
<img src="codeproject_crispin2.aspx_files/report.gif" alt="Broken Article?" style="vertical-align: middle;" width="16" height="16">
<a id="ctl00_ArticleHeaderLinks_BrokenLnk" href="http://www.codeproject.com/script/Articles/Report.aspx?aid=27551">Report Article</a>
<img src="codeproject_crispin2.aspx_files/watchon.png" alt="Watch" style="vertical-align: middle;">
<a id="ctl00_ArticleHeaderLinks_ArticleBmkWatch_WatchMe" name="bmw_27551_2" class="" onclick="return watchMe(27551, 2);" href="http://www.codeproject.com/script/Bookmarks/Add.aspx?obid=27551&obtid=2&bma=AddWatch">Watch</a>
<span id="ctl00_ArticleHeaderLinks_ArticleBmkWatch_StatusMsg" class="TinyText" style="visibility: hidden;" name="bmw_27551_2"></span>
<img src="codeproject_crispin2.aspx_files/link.png" alt="Bookmark" style="vertical-align: middle;" width="16" height="16">
<a id="ctl00_ArticleHeaderLinks_ArticleBmk_BookmarkMe" name="bm_27551_2" class="" onclick="return bookmarkMe(27551, 2);" href="http://www.codeproject.com/script/Bookmarks/Add.aspx?obid=27551&obtid=2&bma=AddBookmark">Bookmark</a>
<span id="ctl00_ArticleHeaderLinks_ArticleBmk_StatusMsg" class="TinyText" style="visibility: hidden;" name="bm_27551_2"></span>
<img src="codeproject_crispin2.aspx_files/discuss.gif" alt="Discuss" style="vertical-align: middle;" width="15" height="16">
<a href="#_comments">Discuss</a>
<img src="codeproject_crispin2.aspx_files/mail.gif" alt="Recommend Article" style="vertical-align: middle;" width="16" height="16"> <a id="ctl00_ArticleHeaderLinks_Recommend" href="http://www.codeproject.com/script/common/TellFriend.aspx?obtid=2&obid=27551">Send to a friend</a>
</div>
</td>
<td style="text-align: right; white-space: nowrap; width: 100px;">
<table id="CurRat"><tbody><tr><td>
<table><tbody><tr><td id="ctl00_ArticleRating_VL" style="white-space: nowrap;" class="SmallText" align="right">
<span id="ctl00_ArticleRating_VoteLabel">6 votes for this Article.</span></td>
<td><table border="1" cellpadding="0" cellspacing="0">
<tbody><tr>
<td width="20" bgcolor="White" height="7"><img src="codeproject_crispin2.aspx_files/red.gif" width="20" align="center" border="0" height="7"></td>
<td width="20" bgcolor="White" height="7"><img src="codeproject_crispin2.aspx_files/red.gif" width="20" align="center" border="0" height="7"></td>
<td width="20" bgcolor="White" height="7"><img src="codeproject_crispin2.aspx_files/red.gif" width="20" align="center" border="0" height="7"></td>
<td width="20" bgcolor="White" height="7" nowrap="nowrap"><img src="codeproject_crispin2.aspx_files/red.gif" width="8" align="center" border="0" height="7"></td>
<td width="20" bgcolor="White" height="7"><img src="codeproject_crispin2.aspx_files/white.gif" width="20" align="center" border="0" height="7"></td>
</tr>
</tbody></table>
</td></tr>
<tr id="ctl00_ArticleRating_PopularityRow">
<td colspan="2" class="SmallText" align="right">
<a id="ctl00_ArticleRating_PopularityLnk" title="Calculated as rating x Log10(# votes)" href="http://www.codeproject.com/script/Articles/TopArticles.aspx?ta_so=1">Popularity: 2.65</a>
<span id="ctl00_ArticleRating_PopularityLbl"></span><span id="ratingVal">Rating: <b>3.40</b> out of 5</span></td>
</tr>
</tbody></table>
</td>
<td>
<div>
<table class="HistTable" title="Voting Distribution. Recent data only"><tbody><tr><td><img src="codeproject_crispin2.aspx_files/t.htm" alt="0 votes, 0.0%" title="0 votes, 0.0%" width="10" border="0" height="1"><br>1</td>
<td><img src="codeproject_crispin2.aspx_files/pollcol.gif" alt="2 votes, 33.3%" title="2 votes, 33.3%" width="10" border="0" height="13"><br>2</td>
<td><img src="codeproject_crispin2.aspx_files/pollcol.gif" alt="1 vote, 16.7%" title="1 vote, 16.7%" width="10" border="0" height="6"><br>3</td>
<td><img src="codeproject_crispin2.aspx_files/t.htm" alt="0 votes, 0.0%" title="0 votes, 0.0%" width="10" border="0" height="1"><br>4</td>
<td><img src="codeproject_crispin2.aspx_files/pollcol.gif" alt="3 votes, 50.0%" title="3 votes, 50.0%" width="10" border="0" height="20"><br>5</td>
</tr></tbody></table>
</div>
</td></tr></tbody></table>
</td>
</tr>
</tbody></table>
<div id="ctl00_UneditedRow" class="SmallText" style="border-top: 1px dashed rgb(255, 153, 0); border-bottom: 1px dashed rgb(255, 153, 0); margin: 5px; padding: 5px;">
<b>Note:</b> This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
<a id="ctl00_ReportProblem" href="http://www.codeproject.com/script/Articles/Report.aspx?aid=27551">Report This Article</a>
</div>
<div id="contentdiv">
<!-- Main Page Contents Start -->
<!-- Article Starts -->
<ul class="download">
<li><a href="http://www.codeproject.com/KB/recipes/codeproject_crispin2/Article_Demo1.zip">Download source and demo - 22.95 KB </a></li>
</ul>
<p><img src="codeproject_crispin2.aspx_files/Article.gif" width="552" height="285"></p>
<h2>Introduction</h2>
<p>Artificial <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une algorithms are inspired by the principles and processes of biological <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une systems. This article shows how to develop a simple C# <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une algorithm which models clonal selection, affinity maturation, and antibody interaction. </p>
<h2>Background </h2>
<p>Our <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une
system protects us from pathogenic organisms including bacteria,
viruses, and toxins. It provides a number of levels of defense, with
the skin being the first barrier to infection. Once pathogens have
entered the body, they are handled with the innate <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une system, and then by the acquired <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une response system (see Fig 1.). The innate <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une
system provides protection that is always present. It uses roaming
scavenger cells (phagocytes) to ingest abnormal cells, thus clearing
the system.</p>
<p><img src="codeproject_crispin2.aspx_files/immune1.gif" width="600" height="242"></p>
<div class="caption">Fig 1. Levels of defense in the <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une system</div>
<p>The acquired <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une system provides protection that arises from an <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une response. Substances capable of starting a specific <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une response are called antigens. Nearly all pathogens are antigens. Antibodies are used by the <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une
system to identify and neutralise antigens (foreign bodies), and are
produced from a kind of white blood cell called a B-cell.</p>
<p>Clonal selection models the production of antibodies which bind to
specific antigens. The binding process of receptors is often likened to
a key-lock mechanism. The probability of forming a bond (i.e., match
strength) is referred to as affinity. Clonal selection establishes the
idea that only those antibodies that recognise the antigens are
selected for cloning and mutation. Cloned antibodies mutate in inverse
proportion to how well they match the antigen so that better matching
antigens are mutated less and weakly matching antibodies are mutated
much more. This process is called affinity maturation, and improves the
likelihood of antibodies forming a bond. Immune models also have to
take into account the activity resulting from interactions between
antibodies.</p>
<h2>Optimisation by Immune Algorithm</h2>
<p>From a computer science perspective, modeling the behaviour of the acquired <span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">imm</span>une
system can provide potential new ways of solving problems. The function
optimisation problem involves finding the best solution (either the
peak or trough) to a function bounded by constraints. </p>
<p>In the example code, a test function has been used and is plotted in
Fig. 2. This test function uses the sine function to produce the hilly
plot, and so finding the highest peak is a challenge. The equation is
given by:</p>
<p>Fitness = (15*x*y*(1-x)*(1-y)*sin(9*pi*x)*sin(9*pi*y))<sup>2</sup></p>
<p>This is the function used by Barry Lapthorn in his article entitled 鈥
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -