Skip to content

Commit

Permalink
Add research content
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-FA committed Nov 6, 2024
1 parent ca6f9f2 commit a1828cf
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 21 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ DEPLOY_BRANCH=main npm run deploy

To see the full list of tasks, check the `scripts` section in the [package.json](package.json) file.


## Building a Material Theme

This project uses the Material Design system to create a consistent and visually appealing user interface. Follow the instructions in the [Material Theme Builder](https://material-foundation.github.io/material-theme-builder/) to build your own Material theme. For more information, check the [Material Design website](https://m3.material.io/blog/material-theme-builder).
Expand All @@ -98,13 +97,12 @@ There are two ways to use Google Fonts in a webpage. The first is to download th

3. **Convert the fonts to woff format**. As of August 2024, the current stable version of Flutter does not support `.woff2` fonts. Therefore, the recommended option is to use the old web-optimized format: `.woff`. It should be noted that `.woff` is only supported on mobile and web platforms (but not on desktop). To convert the files we need to follow these steps:

1. Install the [woff2 tool](https://github.com/google/woff2) developed by Google (`woff2_decompress path/to/font.woff2`).
2. Use `woff2_decompress path/to/font.woff2` to decompress the `.woff2` files to `.ttf`.
3. Use an online tool like [FontSquirrel WebFont Generator](https://www.fontsquirrel.com/tools/webfont-generator) to convert the `.ttf` files to `.woff` (use the `Basic` preset).
4. Download the converted files.

> **Note**: FontSquirrel does not support variable fonts. To use variable fonts with Flutter web, you need to stick with `.ttf` files.
1. Install the [woff2 tool](https://github.com/google/woff2) developed by Google (`woff2_decompress path/to/font.woff2`).
2. Use `woff2_decompress path/to/font.woff2` to decompress the `.woff2` files to `.ttf`.
3. Use an online tool like [FontSquirrel WebFont Generator](https://www.fontsquirrel.com/tools/webfont-generator) to convert the `.ttf` files to `.woff` (use the `Basic` preset).
4. Download the converted files.

> **Note**: FontSquirrel does not support variable fonts. To use variable fonts with Flutter web, you need to stick with `.ttf` files.
### A note about Roboto font in Flutter

Expand All @@ -115,3 +113,7 @@ For more information, check the following GitHub issues:
- [Allow dynamic loading of font assets from pubspec.yaml](https://github.com/flutter/flutter/issues/122282)

- [Proposal to Stop downloading google font roboto when the app uses global custom font](https://github.com/flutter/flutter/issues/136118)

### Icons

Most custom icons have been downloaded from [Streamline](https://www.streamlinehq.com/) or from [Font Awesome](https://fontawesome.com/icons).
2 changes: 1 addition & 1 deletion assets/content/en/cv/manyanet_baccalaureate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

_**Average grade**: 10/10_

_**Awards**: Baccalaureate completion with honors._
_**Awards**: Baccalaureate completion with honors_
5 changes: 5 additions & 0 deletions assets/content/en/parallel_bfgp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Parallel Strategies for Best-First Generalized Planning

#### Abstract

In recent years, there has been renewed interest in closing the performance gap between state-of-the-art planning solvers and generalized planning (GP), a research area of AI that studies the automated synthesis of algorithmic-like solutions capable of solving multiple classical planning instances. One of the current advancements has been the introduction of Best-First Generalized Planning (BFGP), a GP algorithm based on a novel solution space that can be explored with heuristic search, one of the foundations of modern planners. This paper evaluates the application of parallel search techniques to BFGP, another critical component in closing the performance gap. We first discuss why BFGP is well suited for parallelization and some of its differentiating characteristics from classical planners. Then, we propose two simple shared-memory parallel strategies with good scaling with the number of cores.
1 change: 0 additions & 1 deletion assets/content/en/tfg.md

This file was deleted.

2 changes: 1 addition & 1 deletion assets/content/es/cv/manyanet_baccalaureate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

_**Average grade**: 10/10_

_**Awards**: Baccalaureate completion with honors._
_**Awards**: Baccalaureate completion with honors_
5 changes: 5 additions & 0 deletions assets/content/es/parallel_bfgp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Parallel Strategies for Best-First Generalized Planning

#### Abstract

In recent years, there has been renewed interest in closing the performance gap between state-of-the-art planning solvers and generalized planning (GP), a research area of AI that studies the automated synthesis of algorithmic-like solutions capable of solving multiple classical planning instances. One of the current advancements has been the introduction of Best-First Generalized Planning (BFGP), a GP algorithm based on a novel solution space that can be explored with heuristic search, one of the foundations of modern planners. This paper evaluates the application of parallel search techniques to BFGP, another critical component in closing the performance gap. We first discuss why BFGP is well suited for parallelization and some of its differentiating characteristics from classical planners. Then, we propose two simple shared-memory parallel strategies with good scaling with the number of cores.
1 change: 0 additions & 1 deletion assets/content/es/tfg.md

This file was deleted.

1 change: 1 addition & 0 deletions assets/icons/pdf-file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 26 additions & 1 deletion lib/data/research_data.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
import '../models/link_data.dart';
import '../models/research_entry.dart';

const researchFiles = [
'tfg.md',
'parallel_bfgp.md',
];

const researchEntries = [
ResearchEntry(
filePath: 'parallel_bfgp.md',
pdfLinks: [
LinkData(
url: 'https://repositori.upf.edu/handle/10230/61315',
text: 'Thesis',
),
LinkData(
url: 'https://arxiv.org/abs/2407.21485',
text: 'Paper',
),
],
githubLinks: [
LinkData(
url: 'https://github.com/Alejandro-FA/bfgp-pp',
text: 'Code',
),
],
),
];
6 changes: 6 additions & 0 deletions lib/models/link_data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class LinkData {
const LinkData({required this.url, String? text}) : text = text ?? url;

final String url;
final String text;
}
13 changes: 13 additions & 0 deletions lib/models/research_entry.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'link_data.dart';

class ResearchEntry {
const ResearchEntry({
required this.filePath,
this.pdfLinks = const [],
this.githubLinks = const [],
});

final String filePath;
final List<LinkData> pdfLinks;
final List<LinkData> githubLinks;
}
2 changes: 1 addition & 1 deletion lib/pages/cv.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CVPage extends StatelessWidget {
final textTheme = theme.textTheme;
final screenWidth = MediaQuery.of(context).size.width;
final double padding = max(
MaterialWindowClass.of(context) <= MaterialWindowClass.medium ? 25 : 50,
MaterialWindowClass.of(context) <= MaterialWindowClass.medium ? 15 : 50,
(screenWidth - MaterialWindowClass.large.minDP) / 2,
);

Expand Down
128 changes: 121 additions & 7 deletions lib/pages/research.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import 'dart:math';

import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

import '../data/research_data.dart';
import '../models/link_data.dart';
import '../models/research_entry.dart';
import '../theme/material_window_class.dart';
import '../widgets/better_link.dart';
import '../widgets/markdown_content.dart';
import '../widgets/page_scaffold.dart';

Expand All @@ -17,7 +21,7 @@ class ResearchPage extends StatelessWidget {
Widget build(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
final double padding = max(
MaterialWindowClass.of(context) <= MaterialWindowClass.medium ? 25 : 50,
MaterialWindowClass.of(context) <= MaterialWindowClass.medium ? 15 : 50,
(screenWidth - MaterialWindowClass.expanded.minDP) / 2,
);

Expand All @@ -31,16 +35,126 @@ class ResearchPage extends StatelessWidget {
horizontal: padding,
),
sliver: SliverList.builder(
itemCount: researchFiles.length,
itemBuilder: (context, index) => Card(
child: Padding(
padding: const EdgeInsets.all(20),
child: MarkdownContent(file: researchFiles[index]),
),
itemCount: researchEntries.length,
itemBuilder: (context, index) => _ResearchItem(
researchEntries[index],
),
),
),
],
);
}
}

class _ResearchItem extends StatelessWidget {
const _ResearchItem(this.entry);

final ResearchEntry entry;

@override
Widget build(BuildContext context) {
final pdfLinks = entry.pdfLinks;
final githubLinks = entry.githubLinks;

return Card(
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
children: [
MarkdownContent(file: entry.filePath),
const SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
...pdfLinks.map(_PdfLink.new),
const Spacer(),
...githubLinks.map(_GithubLink.new),
],
),
],
),
),
);
}
}

class _LinkButton extends StatelessWidget {
const _LinkButton(
this.link, {
required this.iconPath,
required this.backgroundColor,
required this.foregroundColor,
});

final LinkData link;
final String iconPath;
final Color backgroundColor;
final Color foregroundColor;

@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;

return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: BetterLink(
uri: Uri.parse(link.url),
target: LinkTarget.blank,
builder: (context, followLink) => TextButton.icon(
label: Text(
link.text,
style: textTheme.titleSmall?.copyWith(color: foregroundColor),
),
icon: SvgPicture.asset(
iconPath,
height: 22,
colorFilter: ColorFilter.mode(
foregroundColor,
BlendMode.srcIn,
),
),
onPressed: followLink,
style: TextButton.styleFrom(
backgroundColor: backgroundColor,
),
),
),
);
}
}

class _PdfLink extends StatelessWidget {
const _PdfLink(this.link);

final LinkData link;

@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;

return _LinkButton(
link,
iconPath: 'assets/icons/pdf-file.svg',
backgroundColor: colorScheme.errorContainer,
foregroundColor: colorScheme.onErrorContainer,
);
}
}

class _GithubLink extends StatelessWidget {
const _GithubLink(this.link);

final LinkData link;

@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;

return _LinkButton(
link,
iconPath: 'assets/icons/github.svg',
backgroundColor: colorScheme.secondaryContainer,
foregroundColor: colorScheme.onSecondaryContainer,
);
}
}
2 changes: 1 addition & 1 deletion lib/theme/markdown_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MarkdownTheme extends InheritedWidget {
decorationColor: colorScheme.primary,
),
em: TextStyle(color: colorScheme.secondary, fontStyle: FontStyle.normal),
textAlign: WrapAlignment.spaceBetween,
textAlign: WrapAlignment.start,
);
}

Expand Down

0 comments on commit a1828cf

Please sign in to comment.