Thursday 11 February 2016

Fuzzy box implementation in the Matlab

0



Note:This article is for the audience who have prior knowledge of fuzzy sets. This is just implementation of fuzzy sets in Matlab.

Software used: Matlab R2010a

Problem Statement: Food Tipping
Tip is decided on the basis of various attributes. Selected member function for attributes is triangular here. Range is selected so that membership functions don’t overlap with each other.
Input Variable:
S.No.
Attributes
Range
1.
Taste
[0 3]

Delicious
[0 1]

Normal
[1 2]

Rancid
[2 3]
2.
Ambience
[0 3]

Worst
[0 1]

Good
[1 2]

Excellent
[2 3]
3.
Service
[0 3]

Slow
[0 1]

On time
[1 2]

Fast
[2 3]
4.
Price
[0 2]

Reasonable
[0 1]

Costly
[1 2]
5.
Hygiene
[0 2]

Clean
[0 1]

Stinky
[1 2]

Output Variable:
S.No.
Attributes
Range
1.
Tip
[0 1]

100
[0 0.2]

200
[0.2 0.4]

300
[0.4 0.6]

400
[0.6 0.8]

500
[0.8 1]


Steps:
1.Start matlab and type fuzzy in command window.
      2. A new wizard named FIS Editor will open (Fuzzy Inference System).  
      3.Go on Edit->Add variable->Input. Do this for 4 times as we have five input variables. Change name of the input variable by editing the content of Name.

      4.Similarly edit the name of all five variables and output variable. Now save the work in file first. Go to File->Export-> File. Now save the food_tip.fis file. FIS editor will look like as follows:
      5. Double click on the taste input variable to edit the attributes of taste. Taste has three attributes namely: delicious, normal, rancid. New box will pop up named Membership Function Editor. Go to Edit->Remove All MFs. Then Edit-> Add Mfs. Small box asking for type and no of mf will pop up. Select trimf and 3 as we want to use the triangular member function and no of member function is 3. Click Ok.      
                                  

       6.Set range of taste variable as [0 3] (your choice). Edit mf1 name as delicious and its parameters. Parameters in triangular membership function is vertices of triangle. Select [0 0.5 1]. Similarly set all three membership function as required.
    7. Do it for all the variables. Close the membership function editor.




      8. In FIS Editor, go to Edit-> Rules. A new rule Editor will open. Now add rules one by one. Close when you are done.

      9. Now go to View->Rules. See output by varying inputs. First input is [0.5 2.5 2.5 0.5 0.5] = [taste=delicious ambience=excellent service=fast price=reasonable hygiene=clean] (as range of delicious in taste is [0 1] so 0.5 means delicious, similarly others are done) so the tip value is 0.9 so tip would be 500 (as range of 500 is [0.8 1]).

      10.Similarly, you can try for another inputs.
   Fuzzy toolbox implemented in the Matlab successfully.Thanks for reading!!

Tuesday 9 February 2016

Cloudsim with netbeans

5


To install and study examples of cloud sim in netbeans

CloudSim: A Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services
Recently, cloud computing emerged as the leading technology for delivering reliable, secure, fault-tolerant, sustainable, and scalable computational services, which are presented as Software, Infrastructure, or Platform as services (SaaS, IaaS, PaaS). Moreover, these services may be offered in private data centers (private clouds), may be commercially offered for clients (public clouds), or yet it is possible that both public and private clouds are combined in hybrid clouds.
The primary objective of this project is to provide a generalized, and extensible simulation framework that enables seamless modeling, simulation, and experimentation of emerging Cloud computing infrastructures and application services. By using CloudSim, researchers and industry-based developers can focus on specific system design issues that they want to investigate, without getting concerned about the low level details related to Cloud-based infrastructures and services.
CloudSim is powered by jProfiler.
Overview of CloudSim functionalities:

  • support for modeling and simulation of large scale Cloud computing data centers
  • support for modeling and simulation of virtualized server hosts, with customizable policies for provisioning host resources to virtual machines
  • support for modeling and simulation of energy-aware computational resources
  • support for modeling and simulation of data center network topologies and message-passing applications
  • support for modeling and simulation of federated clouds
  • support for dynamic insertion of simulation elements, stop and resume of simulation
  • support for user-defined policies for allocation of hosts to virtual machines and policies for allocation of host resources to virtual machines
Software Required:
Netbeans IDE (version greater than 5) 
CloudSim

Steps:

1.   1. Netbeans Installation:Simply click on the downloaded file and follow it with default settings. Open the netbeans. Click file then new project.
2 Select java and java application.
       3. It will take few seconds to create the project.
4. Give name to your project and uncheck to create main file option.
5. Netbeans will take time to make project.
Once it’s done double click on the new project in solution explorer. Right click on libraries and choose the Add jar files.

Locate the cloud sim folder and you will find cloudsim-3.0.3.jar file. Click on ok.
Now locate the org folder which is present in the examples folder in main cloud sim folder. Copy the org folder.

 6. Right click on the source packages in the solution explorer panel and paste it. To run the example program, open org.cloudbus.cloudsim.examples in source packages. Right click on example you want to run and click run file.

7. Done! See the output below.

Thanks for reading!!