<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Çağrı Tuğberk Masat on Medium]]></title>
        <description><![CDATA[Stories by Çağrı Tuğberk Masat on Medium]]></description>
        <link>https://medium.com/@tugberkmasat?source=rss-3963f990dba2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GoPdUfLTMJFDxdXrUrhbgw.jpeg</url>
            <title>Stories by Çağrı Tuğberk Masat on Medium</title>
            <link>https://medium.com/@tugberkmasat?source=rss-3963f990dba2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:32:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tugberkmasat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ant Colony Optimization: A Comprehensive Mathematical and Algorithmic Overview]]></title>
            <link>https://medium.com/@tugberkmasat/ant-colony-optimization-a-comprehensive-mathematical-and-algorithmic-overview-8f43095a6c91?source=rss-3963f990dba2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f43095a6c91</guid>
            <dc:creator><![CDATA[Çağrı Tuğberk Masat]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 02:51:09 GMT</pubDate>
            <atom:updated>2025-06-20T02:52:50.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*iXRd5b2iRQMIfeifjdLOAw.jpeg" /></figure><p>Ant Colony Optimization, or ACO for short, is a fascinating algorithm inspired by nature — specifically, the way real ants find their paths from their nest to food sources. First introduced by Marco Dorigo in the 1990s, this algorithm has become a powerful tool to solve complex optimization problems in fields like routing, scheduling, and feature selection.</p><h3>How Do Ants Inspire an Algorithm?</h3><p>In nature, ants explore their surroundings randomly at first. When they find food, they carry it back to their nest, leaving behind a chemical trail called pheromone. Other ants sense these pheromone trails and tend to follow paths with stronger pheromone levels. Over time, the shortest paths get reinforced because ants travel them more frequently, while less efficient paths’ pheromone evaporates and fades away.</p><p>This collective behavior forms a self-organizing system, and that’s exactly what the ACO algorithm tries to mimic — but in a computational way.</p><h3>The Core Mechanism of ACO</h3><p>Imagine you have a group of virtual ants looking for a solution to a problem. These ants build their solutions step by step by moving from one choice to another, guided by two main factors:</p><ul><li><strong>Pheromone levels</strong> — numerical values representing how attractive a particular choice is, based on past ants’ experiences.</li><li><strong>Heuristic information</strong> — problem-specific knowledge, like the inverse of the distance between two points, where shorter distances are more desirable.</li></ul><p>When an ant is about to decide where to go next, it weighs these two factors. How much weight each factor has is controlled by parameters: one decides how strongly the ant trusts the pheromone trails, and the other how much it relies on the heuristic knowledge.</p><p>The ant doesn’t always pick the best-looking option outright; instead, it probabilistically chooses based on the combined attractiveness. This balance encourages both exploration of new paths and exploitation of known good paths.</p><h3>The Transition Probability Formula</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*ugOPMna15m89_Z9HZQDtWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXfhmQx5j7PtpkMCYBq8aA.png" /></figure><p>This formula balances pheromone influence and heuristic information to guide probabilistic movement.</p><h3>Updating the Pheromone Trails</h3><p>Once all ants complete their solutions, the algorithm updates the pheromone levels on all edges to reflect solution quality.</p><p>The pheromone update formula is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*QCW_04UDO9V3VTjyR7ZUfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NTXqrdAh4lI5UnCMgw3jAw.png" /></figure><p>This process encourages the reinforcement of good paths while allowing pheromone evaporation to prevent early convergence.</p><h3>Key Parameters You Can Tune</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLUYZXwAlCuwa4vyqUXOYw.png" /></figure><h3>Why Is This Important?</h3><p>ACO cleverly balances between two competing goals:</p><ul><li><strong>Exploration</strong> — trying out new possibilities to avoid missing better solutions.</li><li><strong>Exploitation</strong> — using gathered knowledge to focus on the best-known solutions.</li></ul><p>Thanks to this balance, ACO performs well on a wide range of difficult combinatorial problems where exhaustive search is impossible.</p><h3>Summary of the Algorithm Steps</h3><ol><li>Initialize pheromone levels uniformly.</li><li>Each ant constructs a solution by repeatedly choosing the next option probabilistically based on pheromone and heuristic.</li><li>Evaluate all ants’ solutions.</li><li>Update pheromone trails with evaporation and new deposits.</li><li>Repeat until stopping criteria (e.g., number of iterations or convergence).</li></ol><h3>In Conclusion</h3><p>Ant Colony Optimization takes inspiration from a simple, natural process and turns it into an elegant and effective problem-solving method. Its beauty lies in the interplay between collective intelligence and individual stochastic decisions.</p><p>Understanding the formulas and parameters gives you a solid foundation to apply and even customize ACO for your own challenges.</p><p>If you’d like to see Ant Colony Optimization in action, feel free to check out this iOS project:<br><a href="https://github.com/tmasat/Feature-Selection-With-Ant-Colony-Optimization">https://github.com/tmasat/Feature-Selection-With-Ant-Colony-Optimization</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f43095a6c91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to Protocols and Delegates in iOS Development]]></title>
            <link>https://medium.com/@tugberkmasat/an-introduction-to-protocols-and-delegates-in-ios-development-8640ec40a71b?source=rss-3963f990dba2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8640ec40a71b</guid>
            <dc:creator><![CDATA[Çağrı Tuğberk Masat]]></dc:creator>
            <pubDate>Sat, 27 May 2023 02:57:59 GMT</pubDate>
            <atom:updated>2023-05-27T02:57:59.147Z</atom:updated>
            <content:encoded><![CDATA[<p>Protocols and delegates are fundamental concepts in iOS development that facilitate communication and customization between different objects. Understanding how to use them effectively is essential for building modular and flexible code architectures.</p><p><strong>Overview of Protocols and Delegates</strong></p><p><strong>Protocols</strong> define a set of methods and properties that a class or struct can adopt. They act as a blueprint for functionality and ensure that objects conforming to the protocol implement the required behavior.</p><p><strong>Delegates</strong> are objects that conform to a protocol and act on behalf of another object. They enable one object to communicate and delegate tasks to another object. Delegates help establish loose coupling between objects and promote separation of concerns.</p><h3>Implementing Protocols and Delegates</h3><p>To use protocols and delegates in your iOS app, follow these steps:</p><p><strong>1 — Define a Protocol:</strong> Declare the required methods and properties in the protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pouVAQUKWRo5iLhZZLJJNw.png" /></figure><p><strong>2 — Adopt the Protocol:</strong> Implement the protocol in a class or struct and declare the delegate property.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYA2n-nqkQNJfL3ySBYJRQ.png" /></figure><p><strong>3 — Implement Delegate Methods:</strong> Conform to the protocol and implement the delegate methods in the delegate object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1nj3z5ADBnQlbhJQAMXWg.png" /></figure><p>Finally, protocols and delegates are fundamental building blocks in iOS development that enable communication and customization between objects. By mastering these concepts, you can create more modular and flexible code architectures. Happy coding !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8640ec40a71b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparison Between Page Object and Component Based Model Structure with Gherkin in Cypress]]></title>
            <link>https://medium.com/@tugberkmasat/comparison-between-page-object-and-component-based-model-structure-with-gherkin-in-cypress-5397352eb79?source=rss-3963f990dba2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5397352eb79</guid>
            <dc:creator><![CDATA[Çağrı Tuğberk Masat]]></dc:creator>
            <pubDate>Mon, 23 Jan 2023 08:58:10 GMT</pubDate>
            <atom:updated>2023-01-30T17:11:48.458Z</atom:updated>
            <content:encoded><![CDATA[<p>The Page Object Model is a design pattern that creates an object repository to store all web elements. Each class file contains only the corresponding web page elements.</p><p>Let’ s give an example to write it’ s case, website has 3 different pages which display;<br>1) Audio album<br>2) Video album<br>3) Photo album</p><p>There is a section for these pages that gives information about album type. Let’ s call it as information section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*lsojvfUvbapTJfuJYb4Wow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*GrzQbA7nsGoAS53NtGVhfg.png" /></figure><p>We are starting with Audio Information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*pdkchHz2PJ4TmLRkBsHbTQ.png" /></figure><p>I gave new id for text and title elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIYWo-XMvqz5WTahxU8iWQ.png" /></figure><p>Created a method which gets the audioAlbum constants and check the information section texts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*n7OM7xfTLP55YRQXGH7DGA.png" /></figure><p>To call checkInformationTexts() method, I wrote this gherkin. When I use this gherkin case, I can be able to check information texts on album page <strong>BUT</strong>, I need to do the same steps for Video and Photo pages which means I’ m going to repeat the code.</p><p>Let’ s get jump into component base with that example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*VnNAmczbfgeVh3v8uKyuLg.png" /></figure><p>First, we create a new class which calls ‘BaseComponent’;<br>It’s always important to throw error to get logs easily.</p><p><em>elements() — Every component elements will be stored on related component’ s class.</em></p><p><em>runAllTestCases({ state }) — To run all test cases with that method which is related with desired component.</em></p><p><em>states() — Components have different states to be able to tested. For our example, state can be video or photo and this difference will change the element or texts of the related component.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*djhvUK66tTbDvOIs135KOA.png" /></figure><p>Created a new component class that extends from “BaseComponent”. Although it appears on different pages, the elementId’ s ​​are the same because it is the same component. Text values ​​will be changed according to selected state. (It can be video or photo page.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dx8NBw9kIt68V1Zhbw1dZw.png" /></figure><p>To be able to call information component’ s test, add gherkin step for testing. {string} can be video, audio or photo. (It’s defined on InformationComponent class.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*A9NQTWoJ7FbnSDoDHx8t7g.png" /></figure><p>Finally, we can test our component for these 3 different pages just with 1 “Then” line (Do not forget to change “photo” to “video” or “audio” on Then line) Happy Testing ! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5397352eb79" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>