Skip to content

davidg238/fuzzy_logic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eFLL (embedded Fuzzy Logic Library)

An adaption of the Embedded Fuzzy Logic Library to Toit.

Still very much a work in progress.

Visualization of models

A toy web server provides visualization of the execution of the fuzzy models.
The code runs on either the host or device.

  • run the webserver in examples, e.g. jag run -d host server.toit
  • look at the URL printed to the console, like: Open a browser on: http://192.168.0.130:8080
  • a model index will be shown, click the links to view the models (currently driver, driver_advanced, casco)
  • on the inputs page, move the sliders to change inputs, then click the 'outputs' link, to view the results

model: advanced_driver

ToDos

  • rework test cases to current API
  • implement Fuzzy Control Language (FCL) file reader
  • rework API, to minimum FCL requirements
  • resolve the result discrepancies (<1%) in the test suite, between the .cpp and .toit implementations, reference FuzzyLite

Links

Notes:

Question: If I construct a composite polygon, by removing the interior edges of overlapping polygons, is the centroid of the composite polygon equal to the sum of the weighted centroids.
Answer: Yes, if you construct a composite polygon by removing the interior edges of overlapping polygons, then the centroid of the composite polygon is equal to the sum of the weighted centroids of the individual polygons.

This is because the centroid of a composite polygon is simply the weighted average of the centroids of its constituent polygons, weighted by the area of each polygon. When you remove the interior edges of the overlapping polygons, you effectively create a new polygon whose area is equal to the sum of the areas of the original polygons. Therefore, the centroid of the new polygon is simply the weighted average of the centroids of the original polygons.

To calculate the weighted centroid of the composite polygon, you can follow these steps:

  • Compute the area and centroid of each individual polygon using the formulae for polygon area and centroid.
  • Compute the total area of the composite polygon by summing the areas of the individual polygons.
  • Compute the weighted centroid of each individual polygon by multiplying its centroid coordinates by its area.
  • Sum the weighted centroids of all individual polygons.
  • Divide the sum of the weighted centroids by the total area of the composite polygon to obtain the centroid coordinates of the composite polygon.

By following these steps, you can obtain the centroid of the composite polygon as the sum of the weighted centroids of the individual polygons.

About

An implementation of eFLL in Toit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published